.htaccess利用浏览器缓存无法正常工作

时间:2016-12-29 11:26:27

标签: .htaccess caching

我在.htaccess文件中有以下代码,但它对我不起作用:

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType images/jpg "access 1 year"
ExpiresByType images/jpeg "access 1 year"
ExpiresByType images/gif "access 1 year"
ExpiresByType images/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType images/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>


<ifModule mod_deflate.c>
    <filesMatch "\.(js|css|html|php)$">
        SetOutputFilter DEFLATE
    </filesMatch>
</ifModule>

请告诉我我在这里做错了什么?

0 个答案:

没有答案