Umbraco caching

最后都变了- 提交于 2019-12-11 03:19:27

问题


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 the 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?


回答1:


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




回答2:


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




回答3:


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



来源:https://stackoverflow.com/questions/3263976/umbraco-caching

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!