如何指示浏览器,js文件已更改,而不刷新它将反映在客户端.所以它下载了新的副本

How to indicate the browser that js file has changed and without refreshing it will reflect on client side. So it downloads the new copy?

本文关键字:副本 客户端 下载 刷新 指示 何指示 浏览器 js 文件      更新时间:2023-09-26

当JS文件发生变化时,它将立即反映在客户端而不刷新,并将清除缓存。我怎样才能做到这一点呢?一种方法是Grunt如果你知道另一种方法请告诉我

如果你使用gulp或grunt这些是javascript任务运行器它们会监视js文件如果js文件有任何变化它会立即重新加载页面

https://github.com/gulpjs/gulp

https://scotch.io/tutorials/automate-your-tasks-easily-with-gulp-js

繁重

http://mattbailey.io/a-beginners-guide-to-grunt-redux/