0
<IfModule mod_expires.c>

# Enable expirations
ExpiresActive On

# Default directive
ExpiresDefault "access plus 1 month"

# My favicon
ExpiresByType image/x-icon "access plus 1 year”

# Images
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"

# CSS
ExpiresByType text/css "access 1 month”

# Javascript
ExpiresByType application/javascript "access plus 1 year"

</IfModule>

<ifModule mod_headers.c>
    Header set Connection keep-alive
</ifModule>


#Gzip - compress text, html, javascript, css, xml
<ifmodule mod_deflate.c>
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
</ifmodule>
#End Gzip

Gzip is not working, but everything else works. Server supports .htaccess file, but no matter what I do it won't compress my web site, http://kresimirpereglin.hostzi.com.

Thanks for your time.

4

1 回答 1

0

确保mod_deflate已加载。Gzip 部分包含在一个<IfModule>容器中,因此除非mod_deflate加载,否则不会应用任何内容。

您可以通过查看 httpd.conf 文件进行检查,您应该会看到如下内容:

LoadModule deflate_module modules/mod_deflate.so

确保它未注释。

于 2013-10-15T16:18:50.397 回答