使用php缓存图像时出现问题


Problems caching images with php

我有两个网站,一个用于访问者,一个用于内容。对于第二个,我尝试缓存图像因为当你去到某个url时相同的东西总是在那里。我不知道如何使我的浏览器(Chrome)缓存图像。这是我得到的响应头:

Cache-Control:public, max-age=1401497895
Connection:Keep-Alive
Content-Type:image/png
Date:Fri, 31 May 2013 00:58:15 GMT
Expires:Sat, 31 May 2014 00:58:15 +0000
Keep-Alive:timeout=5, max=100
Pragma:public
Server:Apache/2.2.22 (Ubuntu)
Transfer-Encoding:chunked
X-Powered-By:PHP/5.4.6-1ubuntu1.2

这里是我的PHP设置头:

header('Expires:Sat, 31 May 2014 00:58:15 +0000');
header('Cache-Control:public, max-age=1401497895');
header('Pragma:public');

我做错了什么?我想要最小化图像加载时间。

此外,如果这很重要,我正在从CNAME访问它们,尽管我与正常域有相同的问题。

为什么把max-age设置这么高?你想把它设定为将近50年!

这个应该可以工作,但是我从来没有尝试过这么高的max-age