LibrarySites.Banner

Sitecore Output Cache Clearing Optimization (2/8): Cache Clearing Options

This entry about the OutputCacheClearingOptions class used to manage cache clearing options 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.

This solution uses the OutputCacheClearingOptions class to represent cache clearing options. I was a little worried about serializing this class for the remote event so I kept it overly simple. The OutputCacheClearingOptions class contains the following parameters:

  • CacheKeysMustContainOne: When trawling the cache, for example after rebuilding a search index, only remove keys that contain at least one of the values in this list.
  • CacheKeysMustNotContainAny: When trawling the cache, do not remove keys that contain any of the values in this list. In the current implementation, nothing sets this property.
  • ClearAllOutputCachesCompletely: Clear output caches completely rather than trawling.
  • ClearOutputCachesForSitesNamed: Clear output caches for the sites specified in this list.
  • PublishedSomething: Something was published; clear or trawl.
  • PublishingTargets: Names of publishing targets associated with the publishing operation. In some cases, values indicating multiple publishing targets are available, and in other cases, only a single value.
  • PublishingLanguage: The language associated with the publishing operation.
  • IgnorePublishingLanguage: Clear or trawl caches regardless of the language published. In the current implementation, nothing sets this, but you could configure this behavior by specifying this parameter in cache clearing events.
  • IgnoreIntervals: Clear caches regardless of when this process last cleared them. In the current implementation, nothing sets IgnoreIntervals, but you could configure this behavior by specifying this parameter in cache clearing events.
  • IgnorePublishingTargets: Clear or trawl caches for managed sites associated with databases other than the publishing target. In the current implementation, nothing sets IgnorePublishingTargets, but you could configure this behavior by specifying this parameter in cache clearing events.
  • IgnoreSites: As an optimization, this processor keeps a list of the manages sites for which the cacheHtml property is false.
  • EventName: Used to construct a key into the cache to store the date and time after clearing the cache, for comparison against the interval defined for the site.

Resources