F****3 发帖数: 1504 | 1 请问304 ; Section 10.3.5: Not Modified
到底是什么意思,我看了说明看了半天还是没有懂。到底是信息已经被传达,还是没有
啊? | z***u 发帖数: 70 | 2 是说你请求的网络资源,比如一副图片,在你上次请求之后到你这次请求之前未被修改
过的意思吧?
我一直这么理解的。。。哪位大牛来说一下?
【在 F****3 的大作中提到】 : 请问304 ; Section 10.3.5: Not Modified : 到底是什么意思,我看了说明看了半天还是没有懂。到底是信息已经被传达,还是没有 : 啊?
| f*****m 发帖数: 416 | 3 10.3.5 304 Not Modified
If the client has performed a conditional GET request and access is allowed,
but the document has not been modified, the server SHOULD respond with this
status code. The 304 response MUST NOT contain a message-body, and thus is
always terminated by the first empty line after the header fields.
再查啥是conditional GET
The semantics of the GET method change to a "conditional GET" if the request
message includes an If-Modified-Since, If-Unmodified-Since, If-Match, If-
None-Match, or If-Range header field. A conditional GET method requests that
the entity be transferred only under the circumstances described by the
conditional header field(s). The conditional GET method is intended to
reduce unnecessary network usage by allowing cached entities to be refreshed
without requiring multiple requests or transferring data already held by
the client. | v**n 发帖数: 951 | 4 就是browser在发http get request的时候加了个if-modified-since的field.(这个
content以前被访问过,然后cache了,cache的时候有个timestamp)
如果server回个304(没有content body) 那么browser就知道这个page还没有被修改过
,可以直接用上次的cache做render.
当然如果修改过了,一般会回一个200OK (有content body) 然后browser就把cache
flush用新的page做render
【在 z***u 的大作中提到】 : 是说你请求的网络资源,比如一副图片,在你上次请求之后到你这次请求之前未被修改 : 过的意思吧? : 我一直这么理解的。。。哪位大牛来说一下?
|
|