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?
Umbraco uses ClientDependency for client caching in the backend, ClientDependency stores cached files on the disk, that's why restarting doesn't help, try to change clientDependency code version in /config/ClientDependency.config like on the screen:
Thanks Alex. I changed the number of the client dependency to the one you provided, but my changes to the controller of my property editor are still not being reflected in the backoffice. I've tested it with a few console.logs, but they aren't being displayed.
Am I doing something wrong by saving and building my project each time I make a change in the controller?
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
Hi Nick, thanks for your answer. Where do I add the random query string in my package.manifest?
This is my package.manifest file:
{
propertyEditors: [
{
alias: "My.Media.Crop",
name: "MediaCrop",
editor: {
view: "~/App_Plugins/MediaCrop/mediacrop.html",
hideLabel:true,
},
prevalues: {
fields: [
{
label: "Media Picker Property Alias",
description: "The alias of the Single Media Picker that you want to be able to edit crops for the picked item for",
key: "pickerAlias",
view: "textstring"
},
{
label: "File Property Alias",
description: "eg. umbracoFile (defaults to this if this is empty)",
key: "filePropertyAlias",
view: "textstring"
}, {
label: "Hide Label",
description: 'Hides the property label & description when selected',
key: "hideLabel",
view: "boolean"
}
]
}
}],
javascript: [
'~/App_Plugins/MediaCrop/mediacrop.controller.js',
],
css: ['~/App_Plugins/MediaCrop/mediacrop.css']
}
Clearing cache correctly, updating changes
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?
Hi Thomas
Umbraco uses ClientDependency for client caching in the backend, ClientDependency stores cached files on the disk, that's why restarting doesn't help, try to change clientDependency code version in /config/ClientDependency.config like on the screen:
Or just use this package for changing version of client dependency cache - https://our.umbraco.org/projects/developer-tools/health-check-for-client-dependency-framework/
Thanks,
Alex
Thanks Alex. I changed the number of the client dependency to the one you provided, but my changes to the controller of my property editor are still not being reflected in the backoffice. I've tested it with a few console.logs, but they aren't being displayed.
Am I doing something wrong by saving and building my project each time I make a change in the controller?
Thomas, you don't need to build project each tine if you just change .js file
But you need to change version of ClientDependency cache
Also, check please, are you running the project in Debug mode?
Ah, that might be it. I think I was running the project in release mode, as I am using CTRL+F5 to launch it.
Always run in Debug mode while you are working on it.
Hi Thomas
Did you solve the issue?
Thanks,
Alex
Hi Alex
Yes, i managed to solve it by running the program in debug mode. Now my changes are reflected when i save.
Thanks again.
Glad that it's solved, have a great day!
Hey Thomas
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"
Hi Nick, thanks for your answer. Where do I add the random query string in my package.manifest?
This is my package.manifest file:
Hi Thomas
Nik wanted to say to add query param files like that:
But I think it's better to render clientDependency again, it's better to work with files like it will be on the live environment,
Thanks,
Alex
Deleting the
\App_Data\TEMP\ClientDependency
folder also does the trickrefer to Changes in Plugins' js file not applied due to cache
is working on a reply...