You are here: Administrators Reference > Stale Cache Handling

Stale Cache Handling

To address the problem of slow page delivery that can result from regenerating cache each time an Element changes, CommonSpot includes features for managing stale cache - page content that expires because of related content updates, such as changes affecting page indexes, or cached dynamic content that exceeds a defined limit. Use CommonSpot stale cache to temporarily serve recently expired or "stale" cache to reduce or eliminate delays in delivering content to site visitors. Stale cache can be particularly beneficial to sites with frequently changing content or that make heavy use of Page Indexes or Custom Elements in re-use mode.

Enabling Stale Cache

Enabling cache for dynamic content improves performance by eliminating the need for CommonSpot to re-render certain types of dynamic content for every page request. To make the most effective use of stale cache, first analyze your site to find the best balance between the performance benefits of temporarily serving expired content and your requirements for content freshness. You can define how outdated is “too outdated” for the current page, template, or site, and then configure whether and how long to serve stale cache at each level. You also need to consider the Performance Options defined for your site when deciding on Stale Cache settings and how frequently to rebuild stale cache.

For example, caching all random content for 5 minutes gives most requests the performance benefit of locally stored content, while still maintaining the appearance of dynamic generation. This short limit ensures that updates are delivered quickly, but may negate any performance benefits for infrequently viewed pages. A longer limit (one day, for example) can eliminate most “while you wait” page rendering (especially if a scheduled process rebuilds cache during low-traffic periods), but some content updates will not be immediately available to visitors.

Set stale cache defaults at the site level and optionally override them at the template or page level. Page level overrides template level, and template level overrides site level.

To configure site-wide Stale Cache settings, use Site Admin - Site Properties / Settings - Cache Properties.

To customize settings at the individual template or page level, choose Properties - Cache/Static Settings. Sites can gain significant performance advantages by adjusting these settings, particularly for content that changes frequently.

Note: Stale Cache settings automatically propagate to production servers in Shared Database environments, but you must separately set up Stale Cache for servers in Replication environments.

Stale Cache Processing

Once stale cache is enabled, go to Server Admin - Utilities - Scheduled Jobs to set a schedule for background cache regeneration, to ensure that frequently viewed pages are updated in a timely manner. Configure the Rebuild Stale Cache job to automatically rebuild stale cache on a scheduled basis to minimize the delivery of outdated content. Scheduling this task to run frequently (for example, every two to five minutes) will maximize content freshness and minimize processing time.

Important Note: Unless you schedule this job, CommonSpot does not automatically rebuild stale cache. To ensure content updates, schedule the Rebuild Stale Cache job through Server Administration - Utilities - Scheduled Jobs.

With stale cache jobs enabled, CommonSpot inserts a background process into the ColdFusion Administrator to detect and regenerate recently requested expired content on target servers and updates the oldest stale cache first. Handling updates this way both optimizes page performance and more efficiently processes content changes. You can view status for this background process through the Server Tools utility View Stale Cache Queue.

Note: Both stale cache processing and all scheduled jobs must be separately set up and managed for Replication read-only production servers (ROPs).

Shared Database Options

Shared Database customers who optionally purchase and install a CommonSpot Cache Server have addtional options for handling stale cache. This separately licensed server is dedicated to continuously rebuilding cache for faster content delivery, performing the following functions:

  1. When stale cache is enabled, automatically detects and rebuilds cache for any stale content served.
  2. Continuously rebuilds cache for all pages, ensuring that the cache is always as up-to-date as possible.

Any updates to the cache become automatically available to all servers in a cluster, ensuring the most up-to-date content, and improving overall site performance. See the Shared Database Configuration Guide for more information.

 

Related Links


You can download PDF versions of the Content Contributor's, Administrator's, and Elements Reference documents from the support section of paperthin.com (requires login).


For technical support:

http://www.paperthin.com/support/