Correctly clearing cache in Umbraco 7
Asked Answered
D

2

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?

Dermatoglyphics answered 2/10, 2017 at 6:50 Comment(1)
Are you sure this is a caching problem? Sounds like the changed are not being saved. Normally when creating a property editor, you shouldnt have to worry about how Umbraco caches data.Superintendency
D
11

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.

Dardan answered 2/10, 2017 at 14:8 Comment(1)
To avoid deleting the cache, you can just edit the ~/config/ClientDependency.config file and increment the serial number. If you are in development, clear your browser cache as well.Obsessive
A
1

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"

Admittance answered 2/10, 2017 at 8:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.