用mod_deflate module开启icdsoft空间的网页gzip压缩
您已经看过
[清空]
    fa-home
    典型案例司法解释法院防疫下载检察院犯罪名人公务员暴力犯罪行政管理强制执行
    当前位置:法律巴士>休闲灌水>IT>用mod_deflate module开启icdsoft空间的网页gzip压缩

    用mod_deflate module开启icdsoft空间的网页gzip压缩

    ITlawbus2016-06-01 20:4032180A+A-

    现在网上介绍的icdsoft空间开启gzip压缩的方法基本是不可用的,根据查阅官方帮助文档,加上亲测,现共享开启gzip压缩方法。

    先解释为什么网上流行的一长串代码方法无效,官方解释是:icdsoft使用的是Apache 2,而mod_gzip是适用于Apache 1.3;在Apache 2环境下,mod_gzip包含在mod_deflate module中。原文:Mod_gzip is a module for the Apache 1.3 Web Server. As we do not use Apache 1.3 on our servers, it is not available with our service. We are using Apache 2. In Apache 2, the functionality of mod_gzip is covered by the mod_deflate module.

    开启mod_deflate的方法:在根目录下的.htaccess(没有就创建一个)添加如下代码即可:

    <IfModule deflate_module>
    AddOutputFilterByType DEFLATE text/css text/csv text/html text/plain text/richtext text/sgml text/tab-separated-values application/javascript application/x-javascript httpd/unix-directory
    AddOutputFilter DEFLATE html htm shtml php php4 pl rb py cgi css js txt
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    </IfModule>

    开启后的压缩率可达80%以上。

    Gzip压缩

    懒人福利包:htaccess.rar

    本文链接:https://www.lawbus.net/articles/73.html

    除作者为转载以外,本站文章均为原创,如需转载请注明“来源:法律巴士

    支持Ctrl+Enter提交
    Copyright © 2011- 法律巴士 All Rights Reserved.  
    Powered by Z-BlogPHP| 湘ICP备2023031007号| 联系我们
       

    湘公网安备43011202000941号