在开发过程中禁用浏览器对CSS和JS文件的缓存 [英] Disable browser caching for css and js file during development

查看:223
本文介绍了在开发过程中禁用浏览器对CSS和JS文件的缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们如何在应用程序开发过程中禁用浏览器缓存,以便每当对本地主机(或任何开发环境)中的css或js文件进行任何更改时,都不必在浏览器上进行强制刷新即可看到更改

How can we disable browser cache during application development process so that whenever we make any changes to the css or js files in localhost(or any development environment) we don't have to do a hard refresh on the browser to see the changes

推荐答案

大多数浏览器(Chrome和Firefox如下图所示)在开发人员工具的网络标签中都有一个选项在开发人员工具打开时禁用缓存。

Most browsers (Chrome and Firefox are shown in the screenshots below) have an option in the Network tab of the Developer's Tools to disable caching while the Developer Tools are open.

< a href = https://i.stack.imgur.com/J8IbB.png rel = nofollow noreferrer>

这篇关于在开发过程中禁用浏览器对CSS和JS文件的缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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