Showing posts from February, 2016

Caching Rendering HTML when conditional rules are applied

Applying Sitecore caching is an essential task when you build your site, It help improve your site general performance and decrease response time significantly , Output HTML cache is one of the different types of cache that Sitecore offers, I almost apply it everywhere on site rendering components. However, If you are applying Conditional rendering on a component (Personalization) and you are setting different datasources based on some conditions, Applying Caching on that Component with " Vary by Data " option checked will not work as expected, At first i thought that Sitecore will resolve Component datasource by applying the Conditional rules before adding that to the " Cache Key",  That was not the case :( . It turned out that Sitecore uses the default datasource applied on the component to generate the Cache Key, So you will always see the " Default " version of the component on the page, And all of Conditional rules will be ignored. I'm usin