0

I have a case where I needed to apply a hotfix to a component CSHTML view file. I edited the file on both of our Content Delivery servers. I also cleared the entire Sitecore cache via /sitecore/admin/cache.aspx. At that point I was expecting to see the updated HTML on the front end, but it was still in its previous state.

It wasn't until I recycled the IIS app pools that the HTML was updated. If I recall correctly, on all of my other Sitecore projects, whenever a view file was edited and saved, the front end would update almost instantaneously. Why isn't this happening in this case?

Here are the cache settings on the component:

Rendering Cache Settings

Setup:

  • Sitecore 9.0.2
  • Content Management server
  • Two Content Delivery servers
3

The easiest way to clean the HTML cache is to trigger publish.

Sitecore doesn't have watchers on .cshtml files, so it is expected behavior.

1
  • Fair -- though I have evidence that the view cache is in fact cleared on downstream environments but not the PROD environment when making view changes. – Marcel Gruber May 13 at 14:18
0

you can add the htmlCacheSize property to your <sites> node for the website and set cacheHtml property of sites to true to enable the HTML output cache for that site.

Typically these properties come for the website of the <sites> but if you have multisite set up in which your site node is patched then you need to adjust these settings accordingly.

As Sitecore clears HTML cache at each publishing, make sure all of your websites are added to Sitecore.Publishing.HtmlCacheClearer handler to clear the HTML cache of the sites at publish:end event.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.