Dispatcher gracePeriod behavior after content activation in Adobe Experience Manager
This article describes how the gracePeriod parameter in Adobe Experience Manager (AEM) Dispatcher cache settings determines whether stale cache is served to users after cache expiration and before new content is fetched.
Description description
Environment
- Adobe Experience Manager deployment using Dispatcher
- Dispatcher cache configuration with
/gracePeriodunder/cache
Issue/Symptoms
- You need to understand whether Dispatcher serves cached content during the
/gracePeriodafter an activation invalidates an auto-invalidated resource. - The example configuration uses
/gracePeriod "2", where the value is in seconds. - You need to distinguish this setting from cache TTL and from serving stale content when the render server returns an error.
Cause
/gracePeriod limits repeated auto-invalidation by keeping matching cached resources valid for the configured interval after an activation updates a statfile. Dispatcher serves the cached resource during that interval. Another invalidation during the interval extends the window. After the grace window closes, the next request checks the cached resource against the statfile and fetches the current content from the render if the resource is stale. The setting doesn’t start when an HTTP cache TTL expires. Serving invalidated content when the render returns an error is controlled separately by /serveStaleOnError.
Resolution resolution
Follow the steps below to verify Dispatcher grace-period behavior:
- Review the Dispatcher farm’s
/cacheconfiguration. Locate/gracePeriodand check which resources are included in the farm’s/invalidateconfiguration. - Confirm the configured value is in seconds. For example,
/gracePeriod "2"sets a two-second grace period for auto-invalidated resources. - After an activation updates the applicable statfile, request a cached resource that matches the farm’s auto-invalidation rules during the grace period. Dispatcher treats the cached resource as valid during this interval and serves the cached response instead of fetching a fresh version for that request.
- Allow the grace period to pass without another invalidation, then request the resource again. If the cached resource is older than the applicable statfile, Dispatcher fetches the current version from the render and updates the cache.
- If another activation occurs within the grace period, account for the extended window. Each invalidation within the active grace period extends it; therefore, repeated activations can keep the cached resource valid longer than one configured interval.
- Verify the behavior by monitoring cache responses, statfile timestamps, and requests to the render before, during, and after the grace period. Remember that stale-content delivery when the render returns an error is controlled separately by
/serveStaleOnError.