Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

Versioned Clientlibs Dispatcher caching

Avatar

Level 3

I have seen many posts on this but many seem old or potentially outdated as far as what to do. 

 

We are utilizing ACS commons versioned clientlibs. The versioning is working great, but the dispatcher is not recaching the new versioned files. 

 

I have verified that the versioned files are updated from the clientside. But when I navigate to the clientlibs path in the dispatcher, the old versions are still present. I have followed all instructions from different guides on implementing this technique. Is there a commonality or something that stands out that I must be missing on forcing the Dispatcher to cache the new versioned clientlibs?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

There are various ways to achieve the automation of dispatcher flush

all the above are configurable and you can request the flush to specific paths. As @arunpatidar mentioned client- libs will have new version number with each code change so flushing the aem pages will make a fresh request to updated versioned client-libs, however in this case your cache will still create new client libs file with different versions which eventually fill up the cache directory so would recommend you to do the flush for both client-libs and html or as per your requirements 

View solution in original post

6 Replies

Avatar

Community Advisor

I believe your client lib get updated with new code drop and after code drop you don’t see the updated versioned client libs on your dispatcher means your dispatcher is still caching the old cache. So, probably you need a dispatcher flush with each code drop. You can either automate it via a script or you can also use acs-commons dispatcher flush utility to make a flush request on demand.

Avatar

Level 3

Hi Prakash, 

 

Yep, I understand the update to my clientlibs, which is working as expected. I guess it was my understanding, which I am not an expert on, that the Dispatcher would cache the new updated versioned clientlibs. So the dispatcher must still be manually clear then. Is this the normal approach, or is having this automated the typical route? And do you have any documentation or an article to handle this automation for the dispatcher, at least for automatically clearing clientlibs from dispatcher?

Avatar

Correct answer by
Community Advisor

There are various ways to achieve the automation of dispatcher flush

all the above are configurable and you can request the flush to specific paths. As @arunpatidar mentioned client- libs will have new version number with each code change so flushing the aem pages will make a fresh request to updated versioned client-libs, however in this case your cache will still create new client libs file with different versions which eventually fill up the cache directory so would recommend you to do the flush for both client-libs and html or as per your requirements 

Avatar

Level 3

Alright, we currently have a few manual methods for clearing the dispatcher cache. So it sounds like we need to continue this after each deployment. Thank you, this answers my question. 

Avatar

Community Advisor

Hi,

Clientlibs cache does not flush with the clientlibs update. Rather the new version of clientlibs is generated as soon as a page request reach to publisher.

The reference of the clientlibs are in the page source

Example

view-source:https://wknd.site/us/en.html

arunpatidar_0-1696923120312.png

 

 

If you will clear the cache for all the html, then new changes will be appears.



Arun Patidar

Avatar

Community Advisor

@mmasonWD did @arunpatidar @DPrakashRaj help you? Else please explain further your issue.