开发者

Umbraco caching

开发者 https://www.devze.com 2023-01-07 05:26 出处:网络
I\'m having real problem with caching in a macro. I\'ve set the cache period to 0 but still a dropdownlist that returns a list of other items in the content tree won\'t update until I force the applic

I'm having real problem with caching in a macro. I've set the cache period to 0 but still a dropdownlist that returns a list of other items in the content tree won't update until I force the application to recycle e.g. touch the web.config file.

The Macro uses umbraco.content.Instance.XmlContent.SelectSingleNode to select a parent node and then loops through the children and adds these to t开发者_高级运维he dropdownlist.

When I add a new child to this node it doesn't appear in the dropdownlist even if I publish the entire website again.

I'm not sure where this caching is taking place. Can anyone point me in the right direction?


Try adding ?umbdebug=true or ?umbdebugshowtrace=true to any page on your website, it will display trace/macro information.

This video series, maybe helpful http://umbraco.tv/documentation/videos/for-developers/foundation/macro-caching


Try putting umbraco.library.UpdateDocumentCache(docId); before the SelectSingleNode call and see if it works.


You can easily solve your caching problem by providing version to a particular file like css, .js or change something into the web.config file whenever you will go for the deployment.

For example : If we have Script.js file then change version of file for Script.js ?123.

When we changed the version of a file then server will get the latest code from that file.

Let me know if you have any further query.

Thanks

0

精彩评论

暂无评论...
验证码 换一张
取 消