【发布时间】:2011-01-11 18:44:54
【问题描述】:
我正在尝试在我的网站上使用 gzip。
我正在尝试压缩 php、css 和 js 文件。服务器是apache 1.3,我在.htaccess文件中的代码是:
# compress all text & html:
AddOutputFilterByType DEFLATE text/html text/plain text/xml
但是当我上传这个时,我只是得到一个错误 500 页面。
任何想法。
【问题讨论】:
-
您的 Apache 错误日志说明了什么?那里可能有更多细节......
-
使用以下内容似乎根本没有任何效果:
<IfModule mod_gzip.c> mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file \.(html?|txt|css|js|php|pl|jpg|png|gif)$ mod_gzip_item_include handler ^cgi-script$ mod_gzip_item_include mime ^text/.* mod_gzip_item_include mime ^application/x-javascript.* mod_gzip_item_exclude mime ^image/.* mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.* </IfModule>