29 Using Cache Management with WebCenter Sites

For all components to work together in your site, you must configure the rendering engine cache properly. Learn about some important caching concepts such as the rendering engine cache and its components. Also learn which cache configuration properties enable CacheManager to clear all caches (ContentServer, BlobServer, and Satellite Server caches) of any object that becomes obsolete because of changes in its underlying content.

Topics:

About the WebCenter Sites Rendering Engine Cache

The WebCenter Sites rendering engine cache is a two-tier cache. Tier 1 consists of ContentServer and BlobServer. And, tier 2 consists of Satellite Server.

Each component is independently configurable, with controls that fine-tune cache size, cache timeout, and dependency management behavior.

If the components are configured correctly, WebCenter Sites can effectively prevent users from viewing uncached content nearly all of the time. However, if these components are mis-configured, the behavior of WebCenter Sites can be non-intuitive and unpredictable. Inadequate caching can hamper performance, and improper co-ordination of the cache inventory can result in stale content being rendered. To address this, WebCenter Sites includes a module called CacheManager, which can actively manage the cache on behalf of the whole system.

About the CacheManager

CacheManager can record the existence of a compositional dependency against an object that is to be cached by the rendering engine. For example, if a pagelet renders an asset, then the asset is a compositional dependency on that page. If the asset changes, the page is no longer valid and must be flushed from cache.

Using CacheManager to flush the cache requires that you surrender full control over the lifecycle of rendering engine cache objects to CacheManager. You do this by specifying that the objects never expire from the cache. When CacheManager determines that they are obsolete because of changes in the underlying content (that is, in one of the compositional dependencies recorded against each object), it removes those objects from the cache.

Note:

When you specify an infinite expiration time, CacheManager keeps a record of all objects that are cached, and what dependencies are tracked against them. This record is stored on WebCenter Sites, and it is linked to the cached object on the first tier. This record enables CacheManager to infer the existence of objects in the second tier cache and therefore flush the objects from the second tier cache.

If an object expires from the cache, its record is removed, leaving CacheManager without the information it requires to properly flush the object from the second tier cache.

CacheManager features are almost completely automatically enabled.

  • By default, the cache is configured so that objects never expire.

  • Compositional dependencies are recorded against the Blob and Page cache on the lower tier. Tags such as <asset:load> and <render:sateliteblob> provide automatic compositional dependency recording (see the Tag Reference for Oracle WebCenter Sites Reference for a complete list), whereas the two tags <portal:logdep>, and <render:logdep> provide explicit compositional dependency recording.

  • Whenever assets are modified or published, WebCenter Sites automatically invokes CacheManager to purge the old content from the cache and, in the case of publishing, instructs CacheManager to pre-cache the new content in the background before flushing the second tier cache.

Site visitors enjoy the best possible cache performance when they only view cached content.

Enabling CacheManager

Learn about Tier 1 properties that regulate Page and BlobServer blob cache and Tier 2 properties that deal with the Satellite Server page and blob cache.

These topics describe the Tier 1 and Tier 2 cache configuration properties and how they must be set to enable CacheManager.

Tier 1 Cache Configuration Properties

The tables in this section describe properties that regulate the page cache and BlobServer blob cache.

See the Property Files Reference for Oracle WebCenter Sites.

The following table describes page cache properties:

Table 29-1 WebCenter Sites Page Cache Properties

Property Description

cs.IItemList

This property specifies the class implementing the IItemList interface.

An illegal value results in CacheManager having no effect.

The following table describes BlobServer cache properties:

Table 29-2 BlobServer Cache Properties

Property Description

bs.bCacheTimeout

This property specifies how many seconds a blob should remain cached by BlobServer.

bs.bCacheSize

This property specifies how many blobs will be stored in the BlobServer cache. This has no effect on CacheManager.

cs.recordBlobInventory

This property specifies whether compositional dependencies should be recorded against blobs.

This property must be set to true (the default) for CacheManager to operate on blobs.

bs.security

This property controls the security feature of BlobServer.

When BlobServer security is enabled, caching is disabled. Consequently, BlobServer security is incompatible with CacheManager's Intelligent Cache Management features.

By default, this level of security is disabled.

Tier 2 Cache Configuration Properties

Tier 2 cache configuration properties deal with the Satellite Server cache, both page and blob.

None of the Tier 2 properties affect the correct operation of CacheManager. They do, however, serve as important diagnostic aids if CacheManager is operating incorrectly. The timeout and configuration values of the Tier 2 cache properties are important in troubleshooting unpredictable behavior.

Typically, unpredictable behavior results when objects are cached on the Tier  2 cache but not on the Tier  1 cache, and so they are not actively flushed when the dependent asset is saved or published. See the Property Files Reference for Oracle WebCenter Sites for configuration details.

Unpredictable behavior can also result if no compositional dependency is recorded against an object that is cached. This scenario precludes all active management of that object in the caches. See the Tag Reference for Oracle WebCenter Sites Reference for details about which tags automatically record compositional dependencies, and which tags must be used in conjunction with explicit recording using one of the :logdep tags.

Note:

Do not record excessive compositional dependencies on your pages or blobs. This causes unnecessary flushing of the cache, which under certain circumstances can result in severe performance problems during publishing. Be very careful when recording unknown compositional dependencies. See Coding Elements for Templates and CSElements.