如何压缩初始text / html请求?

时间:2017-02-11 19:41:10

标签: .htaccess gzip deflate

我在.htaccess文件中使用以下行来启用压缩:

AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript text/javascript application/json image/svg+xml image/jpeg

除了初始的html请求之外,这个工作正常。有没有办法压缩html?

这就是我的要求:

响应标题

Connection: close Content-Type: text/html; charset=UTF-8 Server: Apache/2.2.15 (CentOS) Transfer-Encoding: chunked X-Powered-By: PHP/5.6.21

请求标题

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 Accept-Encoding: gzip, deflate, sdch Accept-Language: en-US,en;q=0.8,de-DE;q=0.6,de;q=0.4 Cache-Control: no-cache Connection: keep-alive Pragma: no-cache Upgrade-Insecure-Requests:1 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36

0 个答案:

没有答案