Recommendation on Dispatcher Cache Configuration: TTL vs Flush
Hello,
In my project, we have been using classic Dispatcher stat level-based invalidation from the start. This worked fine until we didn't add a lot of content fragments, custom APIs, etc. Now we need custom Dispatcher flush logic to invalidate API paths or pages using queries to fetch the data from content fragments. And with more and more sites going live, it is getting more and more complex.
Looking into this I stumbled upon this AdaptTo presentation that recommends switching completely to the TTL-based invalidation. Therefore the two options are available:
- Option 1: Stick to default/stat file-based invalidation
- Pros: Content is cached longer - until it is changed/republished, new content is immediately available for preview on the AEMaaCS publisher
- Cons: Requires complex invalidation logic for APIs and content fragments
- Option 2: Switch to TTL-based invalidation
- Pros: We can have the same cache rules/headers defined for both Dispatcher and CDN, and no complex invalidation logic is required for APIs and content fragments
- Cons: Cache time would be double as TTL would apply to both Dispatcher and CDN, new content would NOT immediately be available for preview on the AEMaaCS publisher
I am always cheering for simplicity so the 2nd option looks interesting. But I wanted to get some input from the community. Have you tried this? What is your experience? What do you think?
Thanks in advance,
Daniel
