Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

AEM Cache Invalidation using Sling Content Distribution

Avatar

Community Advisor

2/20/24


AEM Cache Invalidation using Sling Content Distribution

  by @Imran__Khan 

Overview

Sling Content Distribution

This blog will help us to clear servlet cache on publish of page or resource. We are going to use sling content distribution API to clear cache.

It is not a best practice to use custom code for invalidate cache explicitly. There are two custom ways we can clear cache using below API’s:

  1. Sling Content Distribution API (preferred)
  2. Replication API to invoke the publish Dispatcher flush replication agent.

Sling content distribution module facilitates the distribution of Sling resources among various Sling instances. Operating at the path level, the API utilizes distribution agents to enable the transfer of specific paths between instances.

Sling content Distribution supports ADD, DELETE and INVALIDATE actions. Within the framework of Sling Content Distribution, cache invalidation is possible upon content publishing, removal, and even without triggering a publication event.


Q&A

Please use this thread to ask questions relating to this article