-
Notifications
You must be signed in to change notification settings - Fork 2
Finding cacheable renderings in Sitecore
You will not print an exactly same family photo whenever you want to see it, right?
Why do you force an application to do so by rendering exactly same markup for each request?
HTML cache allows reusing already produced markup for renderings thereby much speeding up request processing in high loaded solutions.
Sitecore presentation concept is based on renderings
that can set default caching
configuration:
Knowing that every shared field value is stored in SharedFields
table, we can easily find the list of renderings that have caching configured.
Default presentation is be assigned to Standard Values
, thus it can also enforce cacheable settings:
Knowing that:
- Layout is a shared field
- Layout has XML format
SQL query can be composed to get a list of standard values with predefined cacheable presentation:
One directly can assign/modify presentation on items. Knowing that:
- Items do not store the whole
layout
information, but onlydelta
- Latest Sitecore allows storing different presentation for different versions (so-called Final layout)
We can compose one more SQL query.
Re-using rendered markup is crucial for getting high throughput.
Even though Sitecore offers a powerful HTML caching mechanism, people start using it only after stepping into performance issues and high response rates.