Wednesday, June 29, 2016

Sitecore caching data when there is no context

When working with areas in Sitecore where the context is not resolving (such as custom index field or pipelines) the standard HttpContext.Current.Cache would not resolve because HttpContext.Current is null. In this case HttpRuntime.Cache will work instead.

I tend to use caching in custom search index fields where configuration is coming from a Sitecore item. This saves a lot calls to Sitecore and processing of the item to get the required data.

No comments:

Post a Comment