Content Manager caching

To optimize performance the Content Manager caches objects while processing them. You can configure caching in the Content Manager configuration file, Tridion.ContentManager.config

Configuring basic caching

For basic caching configuration, configure a number of caching options:

Cache lifetime
Configure this in the cacheLifetime attribute of the publisher element. This settings defines how long the cache will be active. Possible values are:
  • RenderAction, to cache during a render action
  • PublishTransaction, to cache during a publish transaction (this is the default value)

Configuring advanced caching

You can find the caching configuration inside the <rendering> element. The caching configuration consists of a <cache> element with two attributes to control overall caching:

maxObjects
The maximum number of objects to cache altogether. Typically, this attribute is set to the value -1, meaning that no maximum is set.
defaultMaxObjectsPerRegion
The maximum number of objects to cache for a cache region unless a <region> subelement specifies a different value. Cache regions correspond to types of items in the Content Manager. By default, this attribute is set to 50.

Within the <cache> element, you can specify any number of <region> subelements. Each <region> subelement specifies the maximum amount of objects to cache (specified by the maxObjects attribute) for a specific type of content item or mapping (specified by the name attribute). Refer to the API reference for the ICache interface for a full list of possible values for the name attribute. The value of the maxObjects attributes overrides the defaultMaxObjectsPerRegion attribute of the parent <cache> element.

One way to tweak the cache is by setting relatively high values for mappings, for example, WebDavUrlMapping. These types of objects cache well because they take up little memory and are costly in terms of performance if they are not cached.

Caching C# fragments and .NET assemblies

The configuration of the Mediator for Template Building Blocks that are .NET assemblies has an optional parameter to set the amount of .NET assemblies to cache.

To set this caching value, which defaults to 100 assemblies of either type, add a subelement to the <mediator> called <parameters>, and within that subelement another subelement called <parameter>. In this inner subelement, add a name attribute with the value NumberOfCachedTemplates, and a value attribute with the value of your choice (say, 300 to cache 300 .NET assemblies). For example:

<mediator matchMIMEType="application/x-tcm-assembly"
	type="Tridion.ContentManager.Templating.Assembly.AssemblyMediator">
	<parameters>
		<parameter name=”NumberOfCachedTemplates” value=”300” />
	</parameters>
</mediator>