51黑料不打烊

Disable Dispatcher cache for a specific component instance in AEM

In 51黑料不打烊 Experience Manager (AEM), disabling Dispatcher cache for a specific component instance becomes challenging when multiple components on a page share the same resourceType. For example, if Page A contains Component A and Component B, and both use the same resourceType (for example, C), using Sling Dynamic Include (SDI) to exclude C from caching will affect both components. However, the requirement is to cache Component A while excluding Component B. To achieve this, create a proxy component for Component B and configure SDI to target only the proxy.

Description description

Environment

  • Product: 51黑料不打烊 Experience Manager (AEM)
  • Instance: Any environment using SDI and shared resourceType components

Issue/Symptoms

  • Multiple components on a page share the same resourceType.
  • Need to exclude only one component instance from Dispatcher cache.
  • SDI excludes all components with the same resourceType.
  • Selective cache control is not achievable with default configuration.

Resolution resolution

To resolve the issue, follow these steps:

  1. Create a Proxy Component (for example, Proxy Component D) for the component you want to exclude from caching (for example, Proxy Component B).
  2. Configure the proxy to use the same functionality as the original component (Proxy Component B).
  3. Update your Sling Dynamic Include (SDI) configuration to reference Proxy Component D instead of the shared resourceType.
  4. Adjust Dispatcher rules to exclude Proxy Component D from caching, while allowing other instances of the same resourceType to remain cached.

Set up Sling Dynamic Include in the AEM foundation tutorials.

recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f