Sitecore recently launched 10.1 version of its product and one of the updates really caught my eye – a new setting in Caching section, called Cache Clearing Behavior.
Now, as we already know, Sitecore uses HTML cache to improve performance of the websites, by caching content. There is a painful thing with cache clearing – whenever we publish, it clears all the entire HTML cache, regardless of whether that particular item was updated or not.
Well, not anymore! That is what I found the most fascinating in the release notes of Sitecore 10.1
With Sitecore 10.1 a new option is added called Cache Clearing Behavior. It has the following options:
This is directly linked to another field on the Rendering item – which is Content Dependencies
So, this helps us in deciding the strategy of how to setup partial HTML cache clearing for a a specific component.
Say for example, we want to clear the cache of a component, based on on Publish of a related items along with the usual datasource items, or maybe we want to clear the cache when say the children are published, then it can be done by making the necessary selection above.
This strategy, will not only help in Smart Cache clearing but will also completely remove the need of any custom cache clearers to be written – which sometimes we have to write to take care of the needful.
And the best part, NOT ALL HTML CACHE is CLEARED. 🙂
This feature definitely is going to help in getting a better performing website.
Thank you Sitecore!
References:
Happy Sitecoring! 🙂