[英]How to exclude specific file/s from being Cached in Chrome. (like js files)
We are currently developing a website.我们目前正在开发一个网站。 And everytime we edit "user.js" file and to see our updates we need to hard refresh the page which will cause a longer loading time because it will load all the JS, CSS and IMG again from the server.每次我们编辑“user.js”文件并查看我们的更新时,我们都需要硬刷新页面,这将导致更长的加载时间,因为它将再次从服务器加载所有 JS、CSS 和 IMG。 It tooks more than 5 seconds of waiting.等待时间超过 5 秒。
I can't totally disable caching so the pages will much faster 1-3 seconds.我不能完全禁用缓存,所以页面会快 1-3 秒。
My goal now is to know how to disable cache on specific file or files so the rest of the CSS,JS, and IMG files stays cached.我现在的目标是知道如何禁用特定文件或文件的缓存,以便 CSS、JS 和 IMG 文件的 rest 保持缓存状态。
This will give us effeciency in coding.这将使我们在编码方面更有效率。 Any answer is appreciated.任何答案表示赞赏。
For your specific concern, this is what i do.对于您的具体问题,这就是我所做的。
If you wanted to hard refresh this file every time you edit it, and without hard refreshing the whole page.如果您想在每次编辑时硬刷新此文件,而不是硬刷新整个页面。
You just need to hard refresh that specific file您只需要硬刷新该特定文件
https://xdxd.com/user.js
Then open your page normally on new tab , and must be in new tab so the changes will apply.然后在新选项卡上正常打开您的页面,并且必须在新选项卡中才能应用更改。
That's the trick i am doing.这就是我正在做的伎俩。 If ever i dont want to Hard Refresh the whole website.如果我不想硬刷新整个网站。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.