1

I've been building my angular application using gulp. My index.html file will contain script and style file name with hash value append at the end. This has been used to add revision to file names on every new build using gulp-rev. example:

 styles\app-6e83a19fec.css
 styles\vendor-c68ae715d2.css
 scripts\vendor-03197ad5c4.js
 scripts\app-ec22589d11.js

When I have loaded the base url after new packages are deployed, everything getting loaded from new package.

Sample Url: http://localhost/myapp/

But if we loaded the nested view url after new packages deployed, it still loading the old packages from the cache.

Sample url: http://localhost/myapp/#/profile

I've tried adding the querystring to end of file name in index.html. And also its working properly, by loading new files if we load the base url of site.

If we load the nested view url, the old files are getting loaded.

example:

 styles\app-6e83a19fec.css?v=1.1
 styles\vendor-c68ae715d2.css?v=1.1
 scripts\vendor-03197ad5c4.js?v=1.1
 scripts\app-ec22589d11.js?v=1.1
  • Are you using express? check the cache settings and change it accordingly. – Muli Yulzary Feb 7 '17 at 8:18
  • No @MuliYulzary I'm not using right now – Pandiyan Cool Feb 7 '17 at 9:59
  • What server container are you using then? – Muli Yulzary Feb 7 '17 at 10:04
  • I'm using node js + gulp server – Pandiyan Cool Feb 7 '17 at 10:18

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.