Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.
SOLVED

AEM 6.5 | Custom Cache Invalidation Strategy for Headless Content

Avatar

Level 4

We have several websites running on AEM 6.5 (On-Premise), including both traditional template-based and headless implementations. For the headless sites, we've implemented a custom caching layer to cache persistent query results as per specific business requirements. We also have Dispatcher and CDN level caching which also caches persistent query result.

What’s the recommended approach to invalidate or clear this custom cache when Content Fragments are published?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Mukesh_Kumar_Co 

You need to implement event based cache invalidation, you can leverage Adobe IO to listen publish events from AEM and using Adobe IO runtime you can write some script to invalidate cache at cloud database.

Arun Patidar

AEM LinksLinkedIn

View solution in original post

6 Replies

Avatar

Community Advisor

Hi @Mukesh_Kumar_Co 

I am not sure if you can detect which persistent query are caching a particular Content Fragment.

You can leverage the statefile and invalidate all the dispatcher cache for persistent query with each publish/unpublish.

The CDN cache can be flushed by listening publish/unpublish event and make API calls to explicit CDN cache invalidation.

Arun Patidar

AEM LinksLinkedIn

Avatar

Level 4

Thanks @arunpatidar. Actually it's a custom cache implemented above dispatcher and CDN. Dispatcher and CDN cache is already invalidating after content publishing. Curious if this custom cache should also be flushed by listening publish/unpublish event?

Avatar

Community Advisor

Hi @Mukesh_Kumar_Co 

What is the custom cache? Is it SSG hosted somewhere on the cloud ?

Arun Patidar

AEM LinksLinkedIn

Avatar

Level 4

Yes, cache stored in the cloud database used to optimize the content retrieval. Now we are looking for recommended way to invalidate this cache.

Avatar

Correct answer by
Community Advisor

Hi @Mukesh_Kumar_Co 

You need to implement event based cache invalidation, you can leverage Adobe IO to listen publish events from AEM and using Adobe IO runtime you can write some script to invalidate cache at cloud database.

Arun Patidar

AEM LinksLinkedIn

Avatar

Administrator

@Mukesh_Kumar_Co Just checking in — were you able to resolve your issue? We’d love to hear how things worked out. If the suggestions above helped, marking a response as correct can guide others with similar questions. And if you found another solution, feel free to share it — your insights could really benefit the community. Thanks again for being part of the conversation!



Kautuk Sahni