如何确保并确保我的网页未被缓存? [英] How can I make sure and be sure that my webpage isn't cached?

查看:184
本文介绍了如何确保并确保我的网页未被缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 .css文件在更改时未更新有问题,所有内容都指向缓存。我已清除浏览器缓存,添加版本,甚至更改了链接到另一个.css文件,但没有帮助。



有两个子问题:

a)我还能做什么关于缓存问题?

b)什么时候可以确保每个可能的解决方案都经过测试和不工作,所以这是不太可能的问题是在缓存? strong>



.php和.css文件都在localhost上,在XAMPP沙箱中 - 当以前的选项失败时,我怀疑问题可能是在Apache或任何XAMPP的其他部分,或Firefox处理它有点特别的不在真正的互联网,因此没有删除缓存,尽管广告无缓存。



编辑:我使用Firefox 21.0。我尝试在谷歌Chrome 27.0.1453.116 m下,也没有效果。



EDIT2:原始问题已解决,它证明不是关于缓存。为了防止将来帮助任何人,我添加一个简短的相关问题列表,并接受为他们的答案添加新内容的答案:



样板表未更新



Firefox浏览器不会重新加载更新的CSS / JS文件



强制浏览器重新加载缓存的CSS / JS文件是什么?



确保所有浏览器中的网页没有缓存



最后,一个超级用户:



配置xampp从不缓存来自localhost的页面 <您是否已尝试修改htaccess文件中的缓存控件?




解决方案

尝试此



http://www.chicagostyleseo.com/2010/04/googles-need-for-speed-use-cache-and-htaccess-to -speed-up-your-site /



这具有您的匹配访问文件的缓存控制代码


I have a problem with .css files not being updated while I change it, and everything points to caching. I have cleared browser cache, added versioning, or even changed the link to another .css file, but nothing helped.

There are two subquestion:
a) what else can I do about caching issues?
b) when can I be sure that every possible solution was tested and not working, so it's highly unlikely that the problem is in caching?

Both .php and .css files are on localhost, in XAMPP sandbox - when the previous options failed, I suspect the problem might be either in Apache or in any other part of XAMPP, or that Firefox treats it somewhat special for not being in the "real internet", and thus didn't remove cache for it despite advertising "no cache".

EDIT: I use Firefox 21.0. I tried the same under Google Chrome 27.0.1453.116 m, with no effect too.

EDIT2: the original question was resolved, and it proved NOT to be about caching. Just in case it would help anyone in the future, I add a brief list of related questions and accept the answer that adds something new to their answers:

Stylesheet not updating

Firefox browser does not reload the update CSS/JS files

What is an elegant way to force browsers to reload cached CSS/JS files?

Making sure a web page is not cached, across all browsers

And, finally, one from super user:

Config xampp never to cache pages from localhost

解决方案

Have you tried modifying the cache control in the htaccess file?

Try this

http://www.chicagostyleseo.com/2010/04/googles-need-for-speed-use-cache-and-htaccess-to-speed-up-your-site/

This has the cache control code for your hit access file

这篇关于如何确保并确保我的网页未被缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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