火狐不缓存不尊重? [英] firefox no-cache not honored?

查看:222
本文介绍了火狐不缓存不尊重?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何强制Firefox不缓存响应?我们已经尝试过:

$ $ p $ response.setHeader(Cache-Control,no-cache,no-store,must-重新验证); // HTTP 1.1。
response.setHeader(Pragma,no-cache); // HTTP 1.0。
response.setDateHeader(Expires,0); //代理

但是在about:cache中我们仍然看到:

 缓存条目信息
key:http://myhost.my.domain.com:42133/ducc-servlet/timestamp
提取计数:4
上次提取:2013-03-04 09:21:40
上次修改时间:2013-03-04 09:12:53
过期时间:1969-12-31 19:00:00
数据大小:磁盘上24
文件:无
安全性:本文档没有任何关联的安全信息。
Client:HTTP
request-method:GET
response-head:HTTP / 1.1 200 OK Content-Type:text / html; charset = UTF-8 Cache-Control:no-cache, no-store,must-revalidate
日期:2013年3月3日星期日14:12:57 GMT
过期日期:2013年3月3日星期日14:12:57 GMT
内容长度:24
服务器:Jetty(7.4.4.v20110707)

00000000:32 30 31 33 2e 30 33 2e 30 34 20 30 39 3a 31 32 2013.03.04 09:12
00000010:3a 35 36 20 4d 6f 6e 0a:56 Mon.

谢谢。

<火狐将永远(除非空间不足)将数据存储在缓存中,以便它可以执行诸如查看源代码,只需从缓存中提取数据等等。它可能不会用于正常的页面加载,当然,如果数据设置为no-cache。

如果数据是无存储的,它会把内存中的缓存条目,而不是磁盘上的请求。


How does one force Firefox to not cache a response? We've tried:

response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // HTTP 1.1.
response.setHeader("Pragma", "no-cache"); // HTTP 1.0.
response.setDateHeader("Expires", 0); // Proxies.

but in about:cache we still see:

Cache entry information
key:    http://myhost.my.domain.com:42133/ducc-servlet/timestamp
fetch count:    4
last fetched:    2013-03-04 09:21:40
last modified:    2013-03-04 09:12:53
expires:    1969-12-31 19:00:00
Data size:    24
file on disk:    none
Security:    This document does not have any security info associated with it.
Client:    HTTP
request-method:    GET
response-head:    HTTP/1.1 200 OK Content-Type: text/html;charset=UTF-8 Cache-Control: no-cache, no-store, must-revalidate 
Date: Sun, 03 Mar 2013 14:12:57 GMT 
Expires: Sun, 03 Mar 2013 14:12:57 GMT 
Content-Length: 24 
Server: Jetty(7.4.4.v20110707)

00000000:  32  30  31  33  2e  30  33  2e  30  34  20  30  39  3a  31  32  2013.03.04 09:12
00000010:  3a  35  36  20  4d  6f  6e  0a                                  :56 Mon.

Thanks.

Lou.

解决方案

Firefox will always (unless it runs out of space) store the data in its cache, so that it can do things like view source, save as, etc by just pulling the data from the cache. It might not use it for normal page loads, of course, if the data was set "no-cache".

If the data is no-store, it will put the cache entry in memory, not on disk, as requested.

这篇关于火狐不缓存不尊重?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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