Skip to main content
sreenu539
Level 7
Aug 3, 2018 10:18 PM UTC
Solved

client browser - force cache refresh

Hi,

new js, java code changes introduced for existing login functionality.

When I did a recent deployment to production, a user already loaded the web page with old version of clientlibs.

As user does not have latest js code, login failed until he hit page refresh.

I would like to know is there any way to know user client browser has old version of code and force reload the page or bust the cache, when user makes a request ( triggered as ajax call ) without a page refresh,

Thanks,

Sri

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
arunpatidar
arunpatidarAccepted solution
Community Advisor
Aug 3, 2018 10:55 PM UTC

Hi,

What you looking for is impossible, because you don't know who has already opened your site.

what you can do you can set no-cache header for those files, so those files won't be cached.

Arun Patidar

4 replies

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
Aug 3, 2018 10:55 PM UTC

Hi,

What you looking for is impossible, because you don't know who has already opened your site.

what you can do you can set no-cache header for those files, so those files won't be cached.

Translate
Arun Patidar
smacdonald2008
Level 10
Aug 4, 2018 4:46 PM UTC
sreenu539
sreenu539Author
Level 7
Aug 4, 2018 8:19 PM UTC

Is this AEM known issue. New client libraries js,  css will be loaded only on a page refresh? Not after a new code deployment?

Translate
arunpatidar
Community Advisor
Community Advisor
Aug 4, 2018 9:10 PM UTC

Hi,

New client libraries js,  css will be loaded only on a page refresh but If browser cached those files, it won't be loaded after update. If you always want to serve latest code for login functionality , you should set cache control header for this file.

Without page refresh new code won't be loaded which are directly referred in page e.g. css, jaavscript.

Translate
Arun Patidar