We are enabling dispatcher caching on author (AEM 6.5 AMS). We have set enableTTL as 1. Caching is working fine for us. But the issue comes when we need to clear the cache on demand.
We are using ACS AEM Commons Dispatcher Cache Control Header - Max Age. The cache gets cleared automatically when the max age is reached but we need the provision to clear the cache whenever required.
I have tried using Postman but it didn't work for us as Adobe documentation says "When the enableTTL flag is set and there is a corresponding <filename>.ttl file present in the cache, .stat files will not be considered when determining whether or not the requested <filename> is stale."
Is there a way we can clear the entire cache?
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
If you use the TTL-based invalidation, the .stat-file based invalidation does not work.
But if you activate a page/asset, it will not not only be invalidated based on the stat-file, but in the dispatcher it will be removed as well (so it will re-fetched on the next request). Of course this only works for this page/asset, not for its siblings.
Hi @Abhishek_Narula25
Did you try Delete option?
POST /dispatcher/invalidate.cache HTTP/1.1
CQ-Action: Delete
CQ-Handle: path-pattern
Content-Length: 0
@arunpatidar I tried this already but it didn't work for me.
Hello @Abhishek_Narula25
AEM supports /statfileslevel
and /invalidate
to work together. This provides support for Longer TTL with Invalidation.
Before Dispatcher 4.3.5, the TTL invalidation logic was based only on the configured TTL value. With Dispatcher 4.3.5, both the set TTL and the Dispatcher cache invalidation rules are accounted for. As such, for a cached file:
/enableTTL
is set to 1, the file expiration is checked. If the file has expired according to the set TTL, no other checks are performed and the cached file is re-requested from the backend./enableTTL
is not configured, then the standard cache invalidation rules are applied such as those rules that are set by /statfileslevel and /invalidate. This flow means that Dispatcher can invalidate files for which the TTL has not expired.This new implementation supports use cases where files have a longer TTL (for example, on the CDN) but can still be invalidated even if the TTL has not expired. It favors content freshness over cache-hit ratio on the Dispatcher.
Refer to this: https://experienceleague.adobe.com/docs/experience-manager-dispatcher/using/configuring/dispatcher-c...
I have read this article but the ask here is "Is there any way to clear cache on demand when TTL is enabled?".
I have tried several ways but nothing worked for me.
Can "ACS AEM Commons - Dispatcher Flush UI" help here?
Updating answer, as it is bit incorrect. Apologies ...
The dispatcher version is 4.3.2. Maybe, that's the reason even after touching the .stat file, the cache is not treated as stale.
If you use the TTL-based invalidation, the .stat-file based invalidation does not work.
But if you activate a page/asset, it will not not only be invalidated based on the stat-file, but in the dispatcher it will be removed as well (so it will re-fetched on the next request). Of course this only works for this page/asset, not for its siblings.
Views
Likes
Replies