Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Correctly clearing cache in Umbraco 7

To be honest, I've no idea how Umbraco handles clearing its cache. I'm currently developing a property editor, and I'd like to see the result of my changes in the content section. However whenever i save my changes, build the project and refresh the page, nothing has changed.

I've tried deleting the cache folder, changing the web.config file, installing a special chrome extension to do a hard reset, clearing the entire cache, closing and opening Visual Studio and nothing seems to make any difference.

How can I make Umbraco update its cache to reflect the changes I've made to a property editor in the content section?

like image 724
Leth Avatar asked Jan 03 '23 09:01

Leth


1 Answers

Umbraco joins all of the required assetts together using the Client Dependency Framework. These are then cached and stored at \App_Data\TEMP\ClientDependency\.

You can just delete these to refresh the cache.

You can stop Umbraco from doing using the CDF by putting your application in debug mode. In your Web.config, find the compilation item and change debug to equal true:

<compilation defaultLanguage="c#" debug="true" batch="false" targetFramework="4.5">

When Umbraco is set to debug mode false, calls like this will be done which get the cached version of assets: /DependencyHandler.axd?s=

When Umbraco is in debug mode, direct calls to your custom assets (and any others that are needed) will be made.

You will also need to hard refresh your browser like you were doing before or your browser may locally cache the files too.

like image 146
harvzor Avatar answered Jan 27 '23 12:01

harvzor