javascript - Force cache update on all browsers -


i have mean stack website (single page application) , make sure static files cached browser so:

var app = express(); //express server app.use(express.static(__dirname + "/public", { maxage: 86400000*30 })); app.get("*", function(req, res){ res.sendfile(__dirname + "/public/index.html"); }); 

now in index.html link css , js files so:

<link rel="stylesheet" type="text/css" href="/framework/css/main.min.css?version=1.9"> <script type="text/javascript" src="/framework/js/min/app.min.js?version=1.7"></script> 

notice version control numbers @ end of filenames. now, if update css or js, upload new files , change version control number. should update cache (and does) on page refresh.

the problem is, if user visits site again (and doesn't hit refresh) or if had visited site on mobile , without shutting browser down, opened again on day, don't new files - cached versions.

this causing sorts of issues me. there way force new files served , cached when update made? make updates once every 1 or 2 weeks , site speed, want files cached during time.

google inbox gives small notification "please refresh page - there new version available".

maybe should try approach.

reloading dynamically not piece of cake... have @ these well

is there easy way reload css without reloading page?

dynamically reload local javascript source / json data


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -