标签归档:304

http 304 vs 200 from cache

调试网页的时候 发现有些图片http状态码是200 from cache 有的是304 感觉很奇怪 都是调用缓存 那么之间有什么区别呢?
遂google之

200 (cache) means Firefox is simply using the locally cached version. This is the fastest because no request to the Web server is made.

304 means Firefox is sending a “If-Modified-Since” conditional request to the Web server. If the file has not been updated since the date sent by the browser, the Web server returns a 304 response which essentially tells Firefox to use its cached version. It is not as fast as 200 (cache) because the request is still sent to the Web server, but the server doesn’t have to send the contents of the file.

这是stackoverflow上一个老外说的 具体查看HTTP status code 200 (cache) vs status code 304? 相信大家都看得懂。。俺英文这么烂都明白。。

接下来详细说一下304以及他的好处
继续阅读