Configure Dispatcher cache invalidation scope with statfileslevel in AEM

This article explains how to use the Dispatcher /statfileslevel setting to separate cache invalidation for independent site subtrees, such as /content/siteA and /content/siteB. The setting is measured from the cache docroot, not directly from the AEM repository root. To address this, map the site paths to the Dispatcher cache directory, set the level at the intended site boundary, and test an invalidation under one site.

Description description

Environment

Adobe Experience Manager Dispatcher (all versions)

Issue/Symptoms

  • When content under one site subtree is published, you want to invalidate that site’s cached content without invalidating an independent sibling site subtree.
  • The desired scope depends on the relationship between repository paths and the Dispatcher cache directory under docroot.

Cause

Dispatcher uses /statfileslevel to control where it creates .stat files under the cache docroot. The docroot is level 0. During invalidation, Dispatcher touches .stat files along the path to the invalidated resource, up to the configured level or the resource’s directory depth, whichever is lower. Cached resources are checked against the nearest applicable .stat file. A level that’s too low can leave sites sharing a higher-level invalidation domain; set the level based on the actual cache directory structure and the boundary of the independent site subtree.

Resolution resolution

Follow the steps below to address the issue:

  1. Review the Dispatcher farm configuration under /cache and locate /statfileslevel.
  2. Map the AEM content paths to their corresponding directories in the Dispatcher cache. Identify the configured cache docroot, which is level 0, and count the directory levels below it. If the cache structure is <docroot>/content/siteA and <docroot>/content/siteB, then /content is level 1 and each site root is level 2.
  3. Set /statfileslevel to the level of the intended invalidation boundary. For the example above, /statfileslevel "2" places a .stat file at each site root. Publishing content under /content/siteA touches the .stat files along that path; an independent /content/siteB subtree uses its own site-root .stat file and isn’t invalidated by that change. Note: A higher value doesn’t inherently broaden invalidation. It allows .stat files to be placed deeper in the cache tree, creating more granular invalidation domains where the directory structure supports them. Each invalidation also touches the .stat files along the path up to the configured level. Use this separation only when the site trees are independent; account for shared or cross-site content references in the invalidation design.
  4. After changing the configuration, publish a test change under one site subtree. Verify that the updated site content is invalidated and that an independent sibling site subtree isn’t unnecessarily invalidated.
recommendation-more-help
experience-cloud-kcs-help-kbarticles