AEM 6.2 Dispatcher not Invalidating the Client Libraries automatically

maryw24753203

08-02-2017

Hi all,

  Any Changes to the css and js files under the clientlibs is not picked up by the dispatcher. we need clear the dispatcher cache manually to get the latest changes picked up.

Is there any specific configuration to automatically invalidate the css and js files when there is a change?

any suggestions appreciated.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Jörg_Hoh

Employee

08-02-2017

Hi,

I would recommend to use ACS AEM Commons' feature "Versioned clientlibs" [1]. Then this is not a problem any more, as changes to any clientlib will result in a different hash value.

regards,
Jörg

[1] https://adobe-consulting-services.github.io/acs-aem-commons/features/versioned-clientlibs.html

Answers (6)

Answers (6)

Jörg_Hoh

Employee

29-08-2017

Hi Ruben,

javascript files typically only change when you deploy code. In that case you are supposed to clear the dispatcher anyway, so the pages get re-rendered using the references to the new javascript files.

The versioned clientlibs allow you only to set an unlimited lifetime (for example an expiration date in 2020) to javascript files.

Jörg

There is an add-on for Adobe AEM that does resource fingerprinting (not limited to clientlibs, basically for all static website content), Cache-Control header management and true resource-only flushing of the AEM dispatcher cache. It also deletes updated resources from the dispatcher cache that are not covered by AEM's authoring process (e.g. when you deploy your latest code). A free trial version is available from https://www.browsercachebooster.com/

rubenf42159101

29-08-2017

Hi Jorg,

I'm trying to use version clientlibs for similar requirement. Could you please throw some light on how versioned clientlibs work? How does AEM render the HTML / page with new versioned JS reference given the page / html is already cached?

For example, I have home.html cached and referenced with JS version 'footer.min.abc.js'. Now I make a change in my footer.js. New versioned JS will have 'footer.min.xyz.js'. How AEM render the HTML/page with new versioned JS where my home.html is already cached with footer.min.abc.js?

Thanks and Regards,

Ruben Fernando

edubey

08-02-2017

As Jorg mentioned, version clientlib from ACS is a good option. Every time you change some code in css/js. Different filename  for clientlib (clientlib + hashvalue of data) gets generated. and Since its a new file name, dispatcher will will get it from publish.

Thanks