关于网页压缩gzip的问题及说明教程
最近比较多人反应gzip的问题在wdcp的后台里已经有gzip功能的选项,也就是说,只要在这里开启了,就已支持
但从最近的问题中发现,基本上都是使用一些在线检测的工具来检查的
今天我具体研究测试了下
发现,有些其实已经支持,但在线检测工具检测的结果,却是不支持
具体原因,不太确定,可能是和工具或检测方式有关
这里我给出一个,我觉得更为准确的检查方法
也就是使用curl工具,这个一般Linux都会有,如没有,yum安装下也简单
具体是,在ssh连接到服务器,如我检测的域名是[url=http://www.wdcp.net]www.wdcp.net[/url],刚如下
[root@wdOS ~]# [color=#0000ff]curl -I [url=http://www.wdcp.net]www.wdcp.net[/url] --compressed[/color]
HTTP/1.1 200 OK
Date: Sat, 14 Jul 2012 09:21:05 GMT
Server: Apache
X-Powered-By: PHP/5.2.17p1
[color=#800080]Vary: Accept-Encoding[/color]
Content-Encoding: [color=#ff0000]gzip[/color]
Content-Length: 20
Connection: close
Content-Type: text/html
蓝色字体的为在SSH上输入的内容,下面的是结果
如能看到gzip,刚表明已支持的
在一些在线的检测工具里,如能看到这一行
[color=#80080]Vary: Accept-Encoding[/color]
一般也是已支持的 嗯!不错!了解了 这个不错。 这个真不错 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 大大。这个好像没有开启对PNG gif 等图片的GZIP。难道不支持?我的iis可以的。 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 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 学习了。。 学习了。。。 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 [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 好像我的不可以开启压缩 请怎么解决没有的 [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/
页:
[1]