停止 Chrome 缓存我的 JS 文件 [英] Stop Chrome Caching My JS Files

查看:35
本文介绍了停止 Chrome 缓存我的 JS 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将对我的 JS 文件进行更改,但它不会在浏览器中真正更改,我每次都必须重命名文件,以便重新加载它.是否有某种 .htaccess 命令我可以添加或使其停止缓存?

它甚至缓存我的 html 页面核心.我需要重新打开整个浏览器才能看到更改.会不会是服务器问题?

解决方案

您可以点击右上角的设置图标... |更多工具 |开发者工具 |网络 |禁用缓存(DevTools 打开时)

对于 Windows,这是 F12CTRL + SHIFT + I 而在 Mac 上 CMD + SHIFT + I 打开 DevTools.>

2018 年 9 月 Chrome 更新的新路径:

点击右上角的设置图标... |设置 |偏好 |开发者工具 |网络 |禁用缓存(DevTools 打开时)

I will make a change to my JS files but it won't really change in the browser, I have to rename the files every time so that it reloads it. Is there some sort of .htaccess command I can add or something to make it stop caching?

It is even caching my html pages hard core. I need to reopen my entire browser just to see changes. Could it possibly be a server problem?

解决方案

You can click the settings icon on top right corner ... | More Tools | Developer Tools | Network | Disable cache (while DevTools is open)

For windows, this is F12 or CTRL + SHIFT + I while on mac CMD + SHIFT + I opens up DevTools.

New path for Chrome Update Sept 2018:

Click settings icon on the top right corner ... | Settings | Preferences | Developer Tools | Network | Disable cache (while DevTools is open)

这篇关于停止 Chrome 缓存我的 JS 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆