jeudi 23 juillet 2015

Force browser to update resources of my javascript webapp

I have a angularjs webapp with an index.html file.

My Javascript resources are precompiled using gulp.

So the end result is multiple js files like built.js.

After each release people suffer from cache done by browsers.

I see 2 solutions but don't knwo what is the best one and how to implement it:

  1. change URL of resources in the index.html file to force webbrowser to fetch the new built.js file. How can I automaticly do that ? (using gulp, or git commit hash ?)

  2. improve configuration of nginx: I'm using nginx with a default configuration from ubuntu to serve the static files. Browsers receive 304 status after a release on static files which is weird.

Any other idea are welcomed.




Aucun commentaire:

Enregistrer un commentaire