gzip压缩和利用htaccess中的浏览器缓存不起作用

时间:2018-02-12 08:52:53

标签: php .htaccess gzip

PHP版本5.3.29

SERVER_SOFTWARE:Apache / 2

HTTP_ACCEPT_ENCODING:gzip

gzip压缩:已启用

这是链接:PHPINFO

以下是压缩和利用浏览器缓存的代码 -

<IfModule mod_deflate.c>

`AddOutputFilterByType DEFLATE application/rss+xml`

`AddOutputFilter DEFLATE application/javascript`

`AddOutputFilterByType DEFLATE application/rss+xml`

`AddOutputFilterByType DEFLATE application/vnd.ms-fontobject`

`AddOutputFilterByType DEFLATE application/x-font`

`AddOutputFilterByType DEFLATE application/x-font-opentype`

`AddOutputFilterByType DEFLATE application/x-font-otf`

`AddOutputFilterByType DEFLATE application/x-font-truetype`

`AddOutputFilterByType DEFLATE application/x-font-ttf`

`AddOutputFilterByType DEFLATE application/x-javascript`

`AddOutputFilterByType DEFLATE application/xhtml+xml`

`AddOutputFilterByType DEFLATE application/xml`

`AddOutputFilterByType DEFLATE font/opentype`

`AddOutputFilterByType DEFLATE font/otf`

`AddOutputFilterByType DEFLATE font/ttf`

`AddOutputFilterByType DEFLATE image/svg+xml`

`AddOutputFilterByType DEFLATE image/x-icon`

`AddOutputFilterByType DEFLATE text/css`

`AddOutputFilterByType DEFLATE text/html`

`AddOutputFilterByType DEFLATE text/javascript`

`AddOutputFilterByType DEFLATE text/plain`

`AddOutputFilterByType DEFLATE text/xml`

</IfModule>

到期高速缓存

<IfModule mod_headers.c>

<FilesMatch "\.(jpg|jpeg|png|gif|swf|woff|js|css)$">

Header set Cache-Control "max-age=604800, public"

</FilesMatch>

</IfModule>

我到处检查过。但没有代码正在运作。请有人建议我该怎么做。我正在使用WordPress。我不想使用不必要的插件。这是一个php版本问题吗?

项目链接:Link

0 个答案:

没有答案