HTTP头 - 高速缓存问题 [英] HTTP Headers - Cache Question

查看:128
本文介绍了HTTP头 - 高速缓存问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想提出一个一到图像请求和响应头,我回来是:

I am making a a request to an image and the response headers that I get back are:

Accept-Ranges:bytes
Content-Length:4499
Content-Type:image/png
Date:Tue, 24 May 2011 20:09:39 GMT
ETag:"0cfe867f5b8cb1:0"
Last-Modified:Thu, 20 Jan 2011 22:57:26 GMT
Server:Microsoft-IIS/7.5
X-Powered-By:ASP.NET

请注意不存在的Cache-Control 头的。

在Chrome上的后续请求,铬知道去到缓存中检索图像。它怎么知道使用缓存?我是IM pression,我将不得不与的Cache-Control 头告诉它之下。

On subsequent requests on Chrome, Chrome knows to go to the cache to retrieve the image. How does it know to use the cache? I was under the impression that I would have to tell it with the Cache-Control header.

推荐答案

您同时拥有一个的ETag 的Last-Modified 头。它可能使用这些。但要做到这一点,但它仍然需要做出与如果无 - 匹配的If-Modified-Since的分别。

You have both an ETag and a Last-Modified header. It probably uses those. But for that to happen, it still needs to make a request with If-None-Match or If-Modified-Since respectively.

这篇关于HTTP头 - 高速缓存问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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