如何在开发中禁用CSS缓存,使用PHP后端?
我正在通过Localhost从事PHP/CSS项目,几乎每次更改CSS和Reload页面时,CSS都保持不变,直到删除Cookie,Cache和其他站点数据(即使这样,它也无法立即工作)。 CSS可以正确地链接以及其他所有内容,因此这不是代码的问题,而是浏览器/缓存的问题。
我的问题是 - 除了每次更改CSS中的某些内容时删除cookie和缓存,是否有其他方法可以解决此问题?
I'm working on php/css project through localhost and nearly every time I change css and reload page, css remains unchenged until I delete cookies, cache and other site data (somethimes even then it doesn't work straight away). Css is linked correctly, as well as aeverything else, so this is not a problem with code, but with browser/cache.
My question is- is there a way to resolve this issue other than deleting cookies and cache every time I change something in my css?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请在CSS中添加查询参数,并修改了动态文件:
Please add a query parameter to CSS with dynamic file modified time:
所有的评论和答案都是有帮助的,但是长期没有解决问题。
经过一些实验后,我找到了一个答案:在
Chrome设置中,禁用给定站点的cookie和Cache的缓存>高级隐私与安全>永远无法使用cookie
的网站All the comments and answers were helpful, but none of them solved the problem long term.
After some experimenting, I found an answer: disable saving cookies and cache for given site, in
chrome settings > advanced > Privacy and security > Sites that can never use cookies