Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Avoid clientside cache of JS and CSS in AEM

Avatar

Level 6

Hi,

 

We have implemented SAML configuration in AEM and post that Dispatcher is not creating any cache.

 

But we observed that, browser is creating cache for JS and CSS and if any change happening for JS/CSS will not reflect properly until user clear browser cache.

 

How we can avoid caching of clientlibs in AEM ?

akhilraj_0-1686744016192.png

 


 
Updating Media

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @akhilraj ,

 

Clientlib versioning will resolve this issue. I am assuming you are using AEM on premise since AEM as cloud comes with OOTB Strict clientlib versioning.

 

On premise -

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

 

Cloud -

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

 

Thanks,

Ritesh Mittal

View solution in original post

5 Replies

Avatar

Correct answer by
Community Advisor

Hi @akhilraj ,

 

Clientlib versioning will resolve this issue. I am assuming you are using AEM on premise since AEM as cloud comes with OOTB Strict clientlib versioning.

 

On premise -

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

 

Cloud -

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

 

Thanks,

Ritesh Mittal

Avatar

Level 6

Hi @Ritesh_Mittal ,

 

I tried the steps to make it work.

But initial step of copying itself is providing below error.

akhilraj_0-1686892381329.png

Anything else we have to do for this?

Avatar

Level 6

Hi @Ritesh_Mittal ,

 

Have done the changes and now it is working.

 

If we do some js changes and replicate, the number is changing and changes are reflecting properly.

 

But after how much time, again same file will load from cache ? Now I can see updated file is always loading from server after versioning.

 

But it should load from cache if there is no change, right ?

 

akhilraj_0-1687161040736.png

 

Avatar

Community Advisor

This is a hot topic, and there are several techniques used, but specifically for clientlibs, I would recommend if you are on Premise to use the Versioning Clientlibs from ACS Commons and if you are on Cloud, you can take advantage of versioning client library URLs.

 



Esteban Bustamante