-1

One issue we are running into is that after we push out an update with new JavaScript files, the client browsers still use the cached version of the file and they do not see the update. Obviously, on a support call, we can simply inform them to do a ctrlF5 refresh to ensure that they get the up-to-date files from the server, but it would be preferable to handle this before that time.

I am using,

<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate, 
max-age=0"/>
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
4
  • you are using?? Commented Feb 7, 2019 at 9:40
  • This might be a terrible idea for you, but you can store a 'version no' in each javascript file, and have an api that sends the current version no, and if the javascript files version no is less than the current version no, put up a notification on the screen saying something like "Update this app by pressing ctrl+f5" Commented Feb 7, 2019 at 9:43
  • myfile.1.0.1.js >>>> myfile.1.0.2.js Commented Feb 7, 2019 at 9:52
  • The best way is by giving version number to bundle.js file. Commented Mar 15, 2019 at 2:13

1 Answer 1

1

I think the best approach is to handle this by adding a salt to the assets generated (or even a version number) which is different in each build.

This way the file names will be different every time and the old cached file references will not be used.

Refer here

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.