http Last-Modified不能按预期工作

时间:2013-07-23 14:14:52

标签: http caching http-headers http-caching

响应:

Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection:keep-alive
Content-Type:image/jpeg
Date:Tue, 23 Jul 2013 13:56:05 GMT
Etag:"76a5140090233de1521969b60c7636c1"
Expires:Thu, 19 Nov 1981 08:52:00 GMT
Last-Modified:Mon ,22 Jul 2013 10:16:06 GMT
Pragma:no-cache
Server:nginx/1.2.8
Set-Cookie:lang=en; expires=Thu, 22-Aug-2013 13:56:05 GMT; path=/
Set-Cookie:money=121; expires=Thu, 22-Aug-2013 13:56:05 GMT; path=/
Set-Cookie:UID=6; expires=Thu, 22-Aug-2013 13:56:05 GMT; path=/
Transfer-Encoding:chunked
X-Powered-By:PHP/5.4.13

在回复后,请求是:

Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding:gzip,deflate,sdch
Accept-Language:zh-CN,zh;q=0.8
Cache-Control:no-cache
Connection:keep-alive
Cookie:sid=8cif822kqg6qo4vags10pbm697; PHPSESSID=su382iqj9pdgbl32gqd1fqff03;                     
Host:localhost
Pragma:no-cache
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36
Response Headersview source

如您所见,请求不会按预期发送If-Modified-Since标头。

我错过了其他内容吗?我的浏览​​器不会禁用缓存。

任何人都可以帮助我吗?非常感谢你。

1 个答案:

答案 0 :(得分:0)

在diff nginx 304标题之后,我注意到了原因。

原因是start_session()没有添加缓存头。删除Prgama和Cache-Control头后。一切都向右转。