我正在使用Google頁面速度洞察來提高性能,但無論我做什麼,我都無法獲得'槓桿瀏覽器緩存'消失。利用瀏覽器緩存 - 更新不起作用
我修改了幾個在線文章中描述的htaccess文件,並添加了我可以的每個組合。在頁面洞察中,它抱怨CSS/PNG/JS/JPG文件。
# Expires Caching Start #
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/css "access 2 day"
ExpiresByType text/html "access 2 day"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/x-icon "access 1 year"
ExpiresByType application/pdf "access 1 month"
ExpiresByType application/javascript "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresDefault "access 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType text/x-javascript "access 1 month"
</IfModule>
# Expires Caching End #
該代碼似乎沒有什麼,我已經非常不同。 – connersz
@connersz你試過運行命令嗎? – Edward