我正在使用网页测试来了解我的网站性能。我发现缓存静态内容存在问题,即“利用浏览器缓存静态资产:88/100”
失败 - (没有最大年龄或过期)
我该如何解决这个问题?
我的 htaccess 看起来像:
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/png
AddOutputFilterByType DEFLATE image/jpg
AddOutputFilterByType DEFLATE image/gif
# Or, compress certain file types by extension:
<ifModule mod_deflate.c>
<filesMatch ".(js|css|html|htm|php|jpg|jpeg|woff|eot)$">
SetOutputFilter DEFLATE
</FilesMatch>
</ifModule>
# Direct Apache to send all HTML output to the mod_pagespeed output handler.
AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html
谢谢