firefox的cache和http头信息

作者 : admin 于 2009-09-24 11:05:03
2009
09-24

最近调试squid,发现一个很奇异的问题,程序服务器都配置好后,使用ie狂刷,每次都是HIT,而是用firefoxF5狂刷,结果很多都是MISS,google后发现firefox独有的特性:

如果一个页面访问后,在地址栏再次敲入打开,则走cache,而如果点F5,则firefox发送http请求的时候会自动在头上增加 Cache-Control max-age=0 因此缓存失效。不过正常访问下,还是没有问题的。

原文:

I usually post about problems that I’ve solved. But every once in a while, for all my digging around and googling, I come up on something that I can’t solve quickly and thuroughly enough – so I post about it here in the hope someone can help.

To make a long story short – I’ve found out that FireFox 1.5 appends a “Cache-Control: max-age=0″ HTTP header to requests for ASPX files. This header tells the web server and any proxy servers on the way not to respond with cached version of the requested page and to go and run the actual ASPX instead.

For me, this is a big problem. It renders the NetApp NetCache reverse proxy that I’m using quite useless and impacts badly on response times for that particular page.

Does anybody know why FireFox adds this header to the request? How can this be circumvented either on the browser’s side or on the proxy server’s side?

It took us a bit to work it out.

If you hit refresh, firefox will ask for the latest copy (max-age=0).

If you type the url into the address bar and hit enter, then type it in again, it’ll cache.

Check it works in about:cache.

See also:

http://developer.mozilla.org/en/docs/Using_Firefox_1.5_caching

发表评论




XHTML:你可以使用的标签: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

(若看不到验证码,请重新加载页面。)