Expand my Community achievements bar.

SOLVED

AEM 6.2 Dispatcher not Invalidating the Client Libraries automatically

Avatar

Level 2

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

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

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

View solution in original post

7 Replies

Avatar

Employee

You do activate tree ( of the location of the clientlibs) after the change

Avatar

Correct answer by
Employee Advisor

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

Avatar

Level 10

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

Avatar

Level 2

Thank you all for the Suggestions. we are clearing the cache manually to solve the issue at present and started looking in to ACS commons .

Avatar

Level 3

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

Avatar

Employee Advisor

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

Avatar

Level 1

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/