Home > php教程 > PHP源码 > 开启gzip压缩网站内容

开启gzip压缩网站内容

PHP中文网
Release: 2016-05-25 17:10:26
Original
1215 people have browsed it


SetOutputFilter DEFLATE
    # Don’t compress images and other
    SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI .(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI .(?:pdf|doc)$ no-gzip dont-vary
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css 
    AddOutputFilterByType DEFLATE application/javascript
Copy after login

2. [代码][PHP]代码

在php文件中写入
ob_start('ob_gzhandler');
Copy after login

           

       

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template