English 中文(简体)
Http 304 & Cache-Control: no-cache
原标题:Http 304 & Cache-Control: no-cache

我看到一些电话对网络服务器的反应如下:

<>Initial>:

HTTP/1.1 200 OK
Date: Mon, 16 Jan 2012 05:46:49 GMT
X-Powered-By: Servlet/2.5 JSP/2.1
Content-Type: text/plain
Content-Length: 78
Content-Encoding: gzip
Etag: "pv2052dae8634d971149a927231e3ceddf"
Cache-Control: no-cache
X-PvInfo: [S10202.C6191.A6057.RA6008.G182D.U3FAE8760].[OT/plaintext.OG/documents]
Vary: Accept-Encoding
Set-Cookie: JSESSIONID=l9pLPT5J1tpgK19Fq2qlT0F15ryByWDLgVLz16ffWPm4qQp6nzzx!-518520380; path=/; HttpOnly
DST=rd319o00000000000000000000ffffac16018bo8200; path=/
Connection: close

Subsequent calls:

HTTP/1.1 304 Not Modified
Date: Mon, 16 Jan 2012 05:48:43 GMT
Connection: close
Etag: "pv2052dae8634d971149a927231e3ceddf"
Cache-Control: no-cache
Vary: Accept-Encoding

我不清楚的是,这两条电话都向浏览器退回了<代码>Cache-Control:No-cache指令。

但是,第二电话也回归304 未经修改

鉴于已指示该服务器不要处理先前的答复,服务器预计该网页将如何为数据服务?

有趣的是,I do见浏览器的回复,因此,浏览器虽然没有指示,但似乎将答复安排了起来。 为什么?

最佳回答

A response with Cache-Control: no-cache 并不是说应对措施根本不能储存在客户身上,而是意味着:

If the no-cache directive does not specify a field-name, then a cache MUST NOT use the response to satisfy a subsequent request without successful revalidation with the origin server. This allows an origin server to prevent caching even by caches that have been configured to return stale responses to client requests.

因此,客户可以在当地海滩上储存答复,但需要重新验证原服务器的答复。 如果服务器说,储存在客户切身处的回复仍然有效(即304份答复),则允许客户使用所储存的回复以满足要求。

问题回答

暂无回答




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签