开启gzip压缩网站内容
程序员文章站
2022-04-08 15:27:09
...
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
2. [代码][PHP]代码
在php文件中写入 ob_start('ob_gzhandler');