我在 GTMetirx 上遇到错误:利用浏览器缓存获取以下可缓存资源:
我必须为 png、jpg、woff2、gif、gzip 和 js 文件利用浏览器缓存,但此代码不起作用:
## EXPIRES HEADER CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType image/svg "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType application/javascript "access 1 month"
ExpiresByType application/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>
## EXPIRES HEADER CACHING ##
但是当我添加代码并尝试查看错误是否会得到修复时,它仍然显示相同的错误,有人可以帮忙吗?