Documentation Center

Caching

To optimize performance the Content Manager caches objects while processing them. You can configure caching using the Tridion Content Manager MMC Snap-in to set basic caching options or by editing the Content Manager configuration file Tridion.ContentManager.config directly to set advanced caching options.

Configuring basic caching from the MMC Snap-in

For basic caching configuration, use the MMC Snap-in, the configuration environment for the Content Manager, to configure a number of caching options:

Cache level
Defines which items will be cached. Possible values are:
  • No caching
  • Schemas and Templates
  • All TCM objects except Components and Pages
  • All TCM objects except Pages (this is the default value)
  • All TCM objects
Cache lifetime
Defines how long the cache will be active. Possible values are:
  • Cache during a render action
  • Cache during a publish transaction (this is the default value)
Maximum cached objects
defines the number of cached objects the cache will hold before the Content Manager removes the first cached object and then adds a cached object.

A separate configuation topic explains to learn how to modify these settings.

Configuring advanced caching in the Content Manager configuration file

The MMC Snap-in writes to the Content Manager configuration file, which is called Tridion.ContentManager.config and is located in the config\ subfolder of %TRIDION_HOME% (defaults to C:\Program Files (x86)\Tridion\).

You can also configure advanced caching by editing this file directly in a plain-text or XML editor. Note that any changes you make to the cache configuration will be overwritten if you subsequently configure the cache from the MMC Snap-in.

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>