Sitecore Output Cache Clearing Optimization (8/8): Configuration | John West | Sitecore Blog

This final entry about configuration of the solution is part of a series of blog posts about a custom approach to clearing output caches for managed sites with the Sitecore ASP.NET web Content Management System (CMS) and Experience Platform (XP). For more information, see the Resources section at the end of this blog post.

It might make sense to break the web.config into three configuration files (functionality specific to the publishing instance, such as the publishItem pipeline processor), functionality specific to remote instances (such as the custom remote event), and functionality common to both (such as the pipelines). Unfortunately, this results in three configuration files with some invalid combinations. Therefore I’ve left everything in the single Z.Sitecore.Sharedsource.TrackPublishing.config file. To ensure proper processing order, the name of the web.config include file(s) should follow most or all of the file names in the /App_Config/Include Subdirectory.

This Sitecore.Sharedsource.TrackPublishing.config configuration file:

  • Removes the default HtmlCacheClearer event handler for the publish:end event and adds the custom OutputCacheClearingEventHandler handler
  • Defines the custom:publish:end:remote and specifies the OutputCacheClearingEventHandler handler for that event.
  • Adds the OutputCacheClearingEventHandler handler for the

indexing:end:remote event and specifies the OutputCacheClearingEventHandler handler for that event, where cache keys must contain _#index.

  • Removes the default IndexDependentHtmlCacheManager handler for the

indexing:end event and adds the OutputCacheClearingEventHandler handler, where cache keys must contain _#index.

  • Removes the default HtmlCacheClearer handler from the publish:end:remote event.
  • Adds the TrackPublishing processor to the publishItem pipeline.
  • Defines the clearOutputCaches and scavengeOutputCacheKey pipelines.
  • Adds the outputCacheMinimimInterval and clearOutputCacheAfterPublishingLanguages attributes to the definition for the managed site named website.
  • Adds a hook to manage the custom:publish:end:remote event.