HTTP请求中的缓存(cache)流程
基本字段
不同的情况
普通页面跳转
页面刷新(F5)
强制刷新(Ctrl+F5)
(Request-Line) GET /a.html HTTP/1.1
Host 127.0.0.1
User-Agent Mozilla/5.0 (X11; U; Linux i686; zh-CN; rv:1.9.0.15) Gecko/2009102815 Ubuntu/9.04 (jaunty) Firefox/3.0.15
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language zh-cn,zh;q=0.5
Accept-Encoding gzip,deflate
Accept-Charset gb2312,utf-8;q=0.7,;q=0.7
Keep-Alive 300
Connection keep-alive
Host 127.0.0.1
User-Agent Mozilla/5.0 (X11; U; Linux i686; zh-CN; rv:1.9.0.15) Gecko/2009102815 Ubuntu/9.04 (jaunty) Firefox/3.0.15
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language zh-cn,zh;q=0.5
Accept-Encoding gzip,deflate
Accept-Charset gb2312,utf-8;q=0.7,;q=0.7
Keep-Alive 300
Connection keep-alive
(Status-Line) HTTP/1.1 200 OK
Date Thu, 26 Nov 2009 13:50:54 GMT
Server Apache/2.2.11 (Unix) PHP/5.2.9
Last-Modified Thu, 26 Nov 2009 13:50:19 GMT
Etag “8fb8b-14-4794674acdcc0″
Accept-Ranges bytes
Content-Length 20
Keep-Alive timeout=5, max=100
Connection Keep-Alive
Content-Type text/html
Date Thu, 26 Nov 2009 13:50:54 GMT
Server Apache/2.2.11 (Unix) PHP/5.2.9
Last-Modified Thu, 26 Nov 2009 13:50:19 GMT
Etag “8fb8b-14-4794674acdcc0″
Accept-Ranges bytes
Content-Length 20
Keep-Alive timeout=5, max=100
Connection Keep-Alive
Content-Type text/html
Last-Modified // 指示最后修改的时间
Etag // 指示资源的状态唯一标识
Expires // 指示资源在浏览器缓存中的过期时间
Etag // 指示资源的状态唯一标识
Expires // 指示资源在浏览器缓存中的过期时间
If-Modified-Since Thu, 26 Nov 2009 13:50:19 GMT
If-None-Match ”8fb8b-14-4794674acdcc0″
If-None-Match ”8fb8b-14-4794674acdcc0″
(Status-Line) HTTP/1.1 304 Not Modified
Date Thu, 26 Nov 2009 14:09:07 GMT
Server Apache/2.2.11 (Unix) PHP/5.2.9
Connection Keep-Alive
Keep-Alive timeout=5, max=100
Etag “8fb8b-14-4794674acdcc0″
Date Thu, 26 Nov 2009 14:09:07 GMT
Server Apache/2.2.11 (Unix) PHP/5.2.9
Connection Keep-Alive
Keep-Alive timeout=5, max=100
Etag “8fb8b-14-4794674acdcc0″
If-Modified-Since Wed, 18 Nov 2009 15:54:52 GMT
If-None-Match ”2360492659″
Pragma: no-cache // 禁止缓存
If-None-Match ”2360492659″
Pragma: no-cache // 禁止缓存
If-Modified-Since Wed, 18 Nov 2009 15:54:52 GMT
If-None-Match ”2360492659″
Cache-Control max-age=0 // 文件立即过期
If-None-Match ”2360492659″
Cache-Control max-age=0 // 文件立即过期