Leth
Leth

Reputation: 1059

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?

Upvotes: 7

Views: 14521

Answers (2)

harvzor
harvzor

Reputation: 2908

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.

Upvotes: 11

Nick
Nick

Reputation: 39

Have you tried adding a query string to the end of the URL? Inside the plugin package.manifest your can add a random query string at end of the urls so the browser needs to re cache that url

eg. "~/App_Plugins/Javascript Url" + "?v=123432asdsa"

Upvotes: 1

Related Questions