- 论坛徽章:
- 0
|
都在apache中设置了:
<Directory "/home/web/static">
ExpiresActive On
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType text/javascript "access plus 1 week"
ExpiresDefault "access plus 1 month"
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
然后在通过firefox中的firebug来调试。两个同类的页面。第一个是102次request,第二个是79次。减少的只有图片。
而css,js文件还是再次下载了。看了几个js,css返回的http头:
返回都是:
Date Sat, 10 Feb 2007 02:21:24 GMT
Server Apache
Connection Keep-Alive
Keep-Alive timeout=15, max=100
Etag "209e8-1574-42900dddf9980"
Expires Mon, 12 Mar 2007 02:21:24 GMT
Cache-Control max-age=2592000
和图片的http返回头是一样的。
现在现象就是图片都缓存在本地了,而js,css每次都从网上下载了。 |
|