Board logo

标题: [教程] 关于网页压缩gzip的问题及说明教程 [打印本页]

作者: admin    时间: 2012-7-14 17:30     标题: 关于网页压缩gzip的问题及说明教程

最近比较多人反应gzip的问题
在wdcp的后台里已经有gzip功能的选项,也就是说,只要在这里开启了,就已支持

但从最近的问题中发现,基本上都是使用一些在线检测的工具来检查的
今天我具体研究测试了下
发现,有些其实已经支持,但在线检测工具检测的结果,却是不支持
具体原因,不太确定,可能是和工具或检测方式有关

这里我给出一个,我觉得更为准确的检查方法
也就是使用curl工具,这个一般Linux都会有,如没有,yum安装下也简单

具体是,在ssh连接到服务器,如我检测的域名是www.wdcp.net,刚如下
[root@wdOS ~]# curl -I www.wdcp.net --compressed
HTTP/1.1 200 OK
Date: Sat, 14 Jul 2012 09:21:05 GMT
Server: Apache
X-Powered-By: PHP/5.2.17p1
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 20
Connection: close
Content-Type: text/html


蓝色字体的为在SSH上输入的内容,下面的是结果
如能看到gzip,刚表明已支持的

在一些在线的检测工具里,如能看到这一行
Vary: Accept-Encoding
一般也是已支持的
作者: law    时间: 2012-7-14 18:31

嗯!不错!了解了
作者: yeziye    时间: 2012-7-17 21:11

这个不错。
作者: linaiwei    时间: 2012-10-29 17:01

这个真不错
作者: mm971    时间: 2013-1-9 22:27

HTTP/1.1 301 Moved Permanently
Server: nginx/1.0.15
Date: Wed, 09 Jan 2013 14:24:18 GMT
Content-Type: text/html
Connection: keep-alive
X-Powered-By: PHP/5.2.17p1
location: forum.php
作者: zrpanda    时间: 2013-1-14 21:40

大大。这个好像没有开启对PNG gif 等图片的GZIP。难道不支持?我的iis可以的。
作者: zrpanda    时间: 2013-1-14 21:44

HTTP/1.1 200 OK
Server: nginx/1.0.15
Date: Mon, 14 Jan 2013 13:41:28 GMT
Content-Type: text/html
Connection: keep-alive
Vary: Accept-Encoding
Last-Modified: Sat, 12 Jan 2013 11:38:32 GMT
ETag: "de88d-4922-4d315d9ff3e00"
Content-Encoding: gzip
作者: zrpanda    时间: 2013-1-14 21:45

HTTP/1.1 301 Moved Permanently
Server: nginx/1.0.15
Date: Mon, 14 Jan 2013 13:43:04 GMT
Content-Type: text/html
Connection: keep-alive
X-Powered-By: PHP/5.2.17p1
location: forum.php
作者: 匿名好友    时间: 2013-1-15 10:33

学习了。。
作者: happyboy    时间: 2013-3-25 11:04

学习了。。。
作者: odin1718@qq.com    时间: 2013-4-10 15:15

HTTP/1.1 200 OK
Date: Wed, 10 Apr 2013 07:10:37 GMT
Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.14
X-Powered-By: PHP/5.2.14
Set-Cookie: PHPSESSID=9278d8b01d668eb597988525f710419d; path=/
Content-Type: text/html;charset=GB2312
作者: ghdstui    时间: 2014-2-21 00:38

[root@localhost ~]# curl -I idc.netym.com  --compressed
HTTP/1.0 200 OK
Server: nginx/1.2.9
Date: Thu, 20 Feb 2014 16:28:08 GMT
Content-Type: text/html; charset=utf-8
Vary: Accept-Encoding
X-Powered-By: PHP/5.2.17p1
Set-Cookie: PHPSESSID=03698d1e70d103d026b6d2738c23e714; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-cache, must-revalidate
Pragma: no-cache
X-Cache: MISS from vps74174
X-Cache-Lookup: MISS from vps74174:80
Via: 1.0 vps74174 (squid/3.0.STABLE23-BZR)
Connection: close
作者: hjk7788    时间: 2014-12-1 10:06

好像我的不可以开启压缩
作者: vip8    时间: 2016-6-4 16:59

请怎么解决没有的
作者: xunzhao520    时间: 2019-5-27 23:36

[root@iZ286u9lu31Z ~]# curl -I www.wdcp.net --compressed
HTTP/1.1 301 Moved Permanently
Server: nginx/1.8.1
Date: Mon, 27 May 2019 15:43:54 GMT
Content-Type: text/html
Content-Length: 184
Connection: keep-alive
Location: https://www.wdcp.net/




欢迎光临 WDlinux官方论坛 (http://www.wdlinux.cn/bbs/) Powered by Discuz! 7.2