[英]How to disable cache for some files in google chrome DevTools
Whenever I run the project, many files(CSS, image and js) requested from a remote server and the project load slowly. 每当我运行项目时,从远程服务器请求的许多文件(CSS,图像和js)都将缓慢加载。
For handling this issue, I unchecked disable cache for all files in the network tab of Chrome DevTools(for caching all files) as follows: 为了处理此问题,我在Chrome DevTools的“网络”标签中取消选中了禁用所有文件的缓存(用于缓存所有文件),如下所示:
But the problem started when I need some files(for example test.js,...) don't cache because they change quickly. 但是问题开始于当我需要某些文件(例如test.js,...)不缓存时,因为它们变化很快。
How to disable cache for some files(JS, CSS,...) in google chrome DevTools? 如何在谷歌浏览器DevTools中禁用某些文件(JS,CSS等)的缓存?
There are many ways to disable cache for specific files. 有很多方法可以禁用特定文件的缓存。
Maybe the two most common are: 也许最常见的两个是:
Add query to your script file name ie: 向您的脚本文件名添加查询,即:
<script src="../whatever/someFile.js?version=1234" /> //Where version can be a variable taken from web.config or DateTime.Now() of some sort.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.