Is it necessary to rename .js files to invalidate cache?

谁说我不能喝 提交于 2020-01-15 03:59:06

问题


I want to invalidate cached app.js after every single release.

Short question:

Is it necessary to physically rename(by gulp-rev, for example) app.js to app-a23ds.js every time or is enough to add param with hash in html like app.js?_=<build number>

Description:

I was sure before that is enought to write something like app.js?_=<build number> in index.html to load new file instead of cahed. But when I'm investigate this question deeper I found a few of huge solutions for this case. Like gulp-rev. The main idea of them is to write a new file with new filename (old filename + revisions hash). Is it really neccessary or what?

来源:https://stackoverflow.com/questions/27914767/is-it-necessary-to-rename-js-files-to-invalidate-cache

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!