2

我已经设置了这个过期的标题规则

<IfModule mod_expires.c>
############################################
## Add default Expires header
## http://developer.yahoo.com/performance/rules.html#expires
# Enable expirations
ExpiresActive On
# Default directive
ExpiresDefault "access plus 1 month"
# My favicon
ExpiresByType image/x-icon "access plus 1 year"
# Images
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
# CSS
ExpiresByType text/css "access 1 month"
# Javascript
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType application/js "access plus 1 year"
</IfModule> 

但是当我在 pingdom、gtmetrix、pagespeed 等中对其进行测试时,我看到他们建议我设置过期标题。我需要在我的代码中添加其他内容吗?或者那些服务没有检测到过期的标头?或者还有什么可以解决这个问题?我正在使用 cloundflare 来加快图像加载速度。也许这个?但他们也建议我为 css、js 添加过期标头。但我还没有添加所有这些。

4

0 回答 0