Creating a custom Sitecore-like Context

Often when working in Sitecore we extend the solution using pipeline processors, one of the most common being the httpRequestBegin pipeline. This is also where a lot of the Sitecore goodness happens – site resolving, database resolving, device resolving, language resolving and item resolving – amongst many others.

Resolving things can be expensive. It takes up precious processing time and cpu cycles, so when you have to run a piece of code you only want to do that once. It’s the same reason that Sitecore puts a lot of data into the Context object for use throughout the request. So it would be handy if we could resolve our own code only once and make it available during the request as well.

Read More

Advertisements