简体   繁体   English

如何自动增加版本控制以便浏览器可以自动重新加载 JS/CSS 文件而无需手动清除缓存

[英]How to auto increase versioning so that browser can automatically reload the JS/CSS files without having to clear the cache manually

I am totally new in React Js.我是 React Js 的新手。 Currently I need to auto update the version number whenever I build so that the browser can automatically reload the JS/CSS files without having to clear the cache manually.目前我需要在构建时自动更新版本号,以便浏览器可以自动重新加载 JS/CSS 文件,而无需手动清除缓存。 Is there any way to do this?有没有办法做到这一点? I searched but most of it is for .net answers.我进行了搜索,但其中大部分是针对 .net 的答案。 Really appreciate any guidance and helps..Thank you非常感谢任何指导和帮助..谢谢

Looks like you can easily do this with a small NPM package that is already pre-built看起来您可以使用已经预先构建的小型 NPM package 轻松完成此操作

https://richhewlett.com/2020/07/11/auto-increment-build-number-in-a-javascript-app/ https://richhewlett.com/2020/07/11/auto-increment-build-number-in-a-javascript-app/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM