httpd.conf 中加入
ExpiresActive on
ExpiresByType image/gif "access plus 1 days"
ExpiresByType image/jpeg "access plus 24 hours"
ExpiresByType image/png "access plus 24 hours"
ExpiresByType text/css "now plus 2 hour"
ExpiresByType application/x-javascript "now plus 2 hours"
ExpiresByType application/x-shockwave-flash "now plus 2 hours"
ExpiresDefault "now plus 0 min"
注释:
Expires 语法如下:
ExpiresByType type/encoding " [plus] }*"
其中是下列之一:
access
now (等价于'access')
modification
plus关键字是可选的。
必须是整数,
是下列之一:
years
months
weeks
days
hours
minutes
seconds
参考: http://apache.chinahtml.com/mod/mod_expires.html
ExpiresActive on
ExpiresByType image/gif "access plus 1 days"
ExpiresByType image/jpeg "access plus 24 hours"
ExpiresByType image/png "access plus 24 hours"
ExpiresByType text/css "now plus 2 hour"
ExpiresByType application/x-javascript "now plus 2 hours"
ExpiresByType application/x-shockwave-flash "now plus 2 hours"
ExpiresDefault "now plus 0 min"
注释:
Expires 语法如下:
ExpiresByType type/encoding " [plus] }*"
其中是下列之一:
access
now (等价于'access')
modification
plus关键字是可选的。
必须是整数,
是下列之一:
years
months
weeks
days
hours
minutes
seconds
参考: http://apache.chinahtml.com/mod/mod_expires.html
编辑回复