Avoid clientside cache of JS and CSS in AEM | Community
Skip to main content
akhilraj
Level 5
June 14, 2023
Solved

Avoid clientside cache of JS and CSS in AEM

  • June 14, 2023
  • 2 replies
  • 1409 views

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 ?

 


 
Updating Media

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Ritesh_Mittal

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/content-delivery/caching.html?lang=en#enabling-longcache

 

Thanks,

Ritesh Mittal

2 replies

Ritesh_Mittal
Community Advisor and Adobe Champion
Ritesh_MittalCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
June 14, 2023

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/content-delivery/caching.html?lang=en#enabling-longcache

 

Thanks,

Ritesh Mittal

akhilraj
akhilrajAuthor
Level 5
June 16, 2023

Hi @ritesh_mittal ,

 

I tried the steps to make it work.

But initial step of copying itself is providing below error.

Anything else we have to do for this?

Ritesh_Mittal
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
June 16, 2023

Have you tried restarting your AEM instance?

EstebanBustamante
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
June 14, 2023

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