Expand my Community achievements bar.

AEMaaCS FrontEnd pipeline and dispatcher cache

Avatar

Level 1

Hi everyone!

Colleagues, we use FrontEnd pipelines on our project, but faced with strange behavior, after a pipeline run, the dispatcher cache is not flushed, on pages we see old js/css hashes (even after some significant time, more than that in cache-control header, browser cache is switched off in dev tools).

From java code (bundle com.adobe.cq.com.adobe.aem.wcm.frontend.manager) I see that FrontEnd pipeline updates and 'publishes'  config  only (the one under sling context aware), and seems like doesn't do anything with pages' cache.

Several solutions came to my mind:

  • configure TTL on dispatcher level
  • run a web-tier pipeline after FE pipeline, just to flush cache
  • try ACS Dispatcher flush rules (in latest version they added AEMaaCS support)
  • implement own cache flush service for this
  • manual page activation (worst case)

I like none of the mentioned, since to my mind it should be done as a step for FrontEnd pipeline to ensure new code is on the site.

Please share your experience, how do you flush dispatcher cache after FrontEnd pipeline runs in production programs?

 

Regards,

Ivan Akulenka

 

2 Replies

Avatar

Community Advisor

@IvanAkulenka as per adobe documentation and recommendations you should not explicitly cache anything apart from CDN cache with cache headers, if you are deviations from what is recommended you need to think about alternative solutions.. from above list #1 ttl option is recommended,  if not go with ACS flush rules, based on package deployment see if you can invoke html flush at certain root level..

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/implementing/conten...

 

Avatar

Level 1

Hello @Shashi_Mulugu , thanks for your reply. 

From your message: "you should not explicitly cache anything apart from CDN cache with cache headers" - can you please give a documentation reference or elaborate more on this recommendation?


My understanding from official documentation:

- cache-control header - can be used by browsers (clients) and/or CDN

- Surrogate-Control header - can be used specifically for Fastly CDN (for more granular control)

This is ok and works fine, as expected.

But:

- after CDN a request comes to Apache with Dispatcher module. This module has caching functionality as well (enabled OOTB AEMaaCS).

And this is where we experience troubles, this cache on Dispatcher level is not flushed after FrontEnd pipeline (I see it via requests with a debug header: 

curl -v -H "X-Dispatcher-Info: true" {{URL}}

we can use TTL. At the same time it is a bit weird, that a FrontEnd Pipeline is not flushing the cache when it should.