AEM 6.2 Dispatcher not Invalidating the Client Libraries automatically

Avatar

Avatar

maryw24753203

Avatar

maryw24753203

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)

Avatar

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

910

Correct Answer

1.0K

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

910

Correct Answer

1.0K
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)

Avatar

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

910

Correct Answer

1.0K

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

910

Correct Answer

1.0K
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

Avatar

Avatar

Feike_Visser1

Employee

Avatar

Feike_Visser1

Employee

Feike_Visser1
Employee

08-02-2017

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

Avatar

Avatar

Maximilian_Kolmhuber

Avatar

Maximilian_Kolmhuber

Maximilian_Kolmhuber

06-04-2020

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/

Avatar

Avatar

rubenf42159101

Avatar

rubenf42159101

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

Avatar

Avatar

maryw24753203

Avatar

maryw24753203

maryw24753203

14-02-2017

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

Avatar

edubey

Total Posts

1.5K

Likes

264

Correct Answer

392

Avatar

edubey

Total Posts

1.5K

Likes

264

Correct Answer

392
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