How to clear cache on Sitecore 7.5 delivery server?

牧云@^-^@ 提交于 2020-01-07 03:48:13

问题


I have 2 CD servers using Sitecore 7.5 that have the actual Sitecore interfaces turned off. Is there any way for me to clear the caches on the 2 CD servers? I know that there is probably a way I could write code to do it, but I would be surprised that there is no way to do it out of the box.

Thanks, Corey


回答1:


As @Marek mentioned, you have to have your html cache clearing specified for your site in the web.config. Since you're trying to clear the cache on the CD servers, you have to have this defined in the publish:end:remote event vs the publish:end event.:

      <event name="publish:end:remote">
        <handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache">
          <sites hint="list">
            <site>website</site>
            <site>YOUR SITE DEFINITION SITE NAME HERE</site>
          </sites>
        </handler>
        <handler type="Sitecore.Publishing.RenderingParametersCacheClearer, Sitecore.Kernel" method="ClearCache" />
      </event>

Assuming you have a new site defined that is not the OOTB website site definition, you just have to put your name in where I have YOUR SITE DEFINITION SITE NAME HERE above and your cache should clear on a publish.




回答2:


It couldn't be a neat solution but could fit into your specific requirment.

  • Take Sitecore's page for manual cache refresh. Website\sitecore\admin\cache.aspx
  • Copy into specific directory where you want this page to be accesses from.
  • Decomile Sitecore's dll 'Sitecore.sitecore.admin.CacheAdmin' and remove Sitecore authentication requirment from it and create your custom class.
  • Use that custom class in cache.aspx which you placed in CD server.


来源:https://stackoverflow.com/questions/35436175/how-to-clear-cache-on-sitecore-7-5-delivery-server

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