Friday, 30 September 2016

Sitecore MVC – Custom Vary by cache options

Sitecore, by default, provides varies options like Vary by Data, Vary by Query String to enable HTML cache. Sometimes none of these options (based on component built type) help the component to get cached by Sitecore cache.

This module helps in adding options to cache based on URL and Rendering Unique ID.

After installation, you will see two options in caching section of rendering definition.
-      Vary by URL
Cache key varies by HttpContext AbsolutePath
Can be combined with other options like query string (existing)
-      Vary by Unique ID
Uses rendering unique ID

Also, page presentation component properties will have the same option and there will be an additional option to disable the rendering definition cache settings – Cancel Cache Settings. (ref link)

Now you enable cache based on incoming URL and rendering Unique ID. Also disable the rendering cache setting in Page presentation component properties. 

No comments:

Post a comment


Sitecore 9.3 released!

Sitecore 9.3 has the Solr 8.1.1 support (Sitecore compatibility table is yet to be updated). SIF 2.2.0 Got a new editor - The Horizon edi...