javascript - How to ensure that users are running most up-to-date version of an application instead of a cached version -


we in stages of developing application, regularly releasing updates app fix bugs or add new features. however, our users accidentally run cached versions of app instead of up-to-date version after release. our users not technical , can't step of them through clearing cache. also, not want set no-cache because our app rather large. have seen on other posts programmatically clearing cache not option. practical solutions?

one trick place different parameter in url. should force browser download new version.

for example:

<script src="main.js?version=1"> 

and:

<script src="main.js?version=1.1"> 

and on. or longer random string, guid, should never repeat.

i'm not huge fan of approach myself, quick , easy , common.

if have full access expiry server sets on such files, , know it's going changing, can tell browser not store cached version long.

for example:

expiresbytype text/javascript           "access plus 1 day" 

putting in .htaccess document on server right permissions tell browser store cached version of js 24 hours.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -