Jun 14, 2016

Sitecore Rendering Caching

Ultimately a CMS is in place to give a UI presence to a content contributor or admin to have the flexibility to change the site with minimal (to none at all) support from developers.  Having that said, even caching (which would more than likely be geared toward the admin type users), should still be configurable without the need of developers.

Sitecore renderings have the ability to be cached in one of two ways, either through code, or through the Sitecore UI on the rendering itself.  Let me explain.

Through Code:

@Html.Sitecore().Rendering(RENDERING-ID, new { Cacheable = true, VaryByData = true, CacheKey = "ANYTHING" })

This really forces caching, and the admins have to rely on the support team to reset the app pool to turn off caching, or run some sort of utility.  Seems to be more obtrusive on the admin's day and would require more coffee.

However through the Sitecore system:


@Html.Sitecore().Rendering(RENDERING-ID)

This gives the admin the ability to login to Sitecore and check the boxes appropriate to the need and the site reacts accordingly. Only one cup of coffee for the admin person on this particular morning.

So do your admins a favor and put the power in their hands, which in the end allows the developers to move onto bigger and brighter strategies.

Enjoy!

No comments:

Post a Comment