如何判断我的服务器是否提供GZipped内容? [英] How can I tell if my server is serving GZipped content?
本文介绍了如何判断我的服务器是否提供GZipped内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在NGinx服务器上有一个webapp。我在conf文件中设置 gzip在
,现在我想看看它是否工作。 YSlow说不是,但是6个网站中有5个做测试说这是。
I have a webapp on a NGinx server. I set gzip on
in the conf file and now I'm trying to see if it works. YSlow says it's not, but 5 out of 6 websites that do the test say it is. How can I get a definite answer on this and why is there a difference in the results?
推荐答案
这看起来像一个可能的答案是,不出意料, curl
:
It looks like one possible answer is, unsurprisingly, curl
:
$ curl http://example.com/ --silent --write-out "%{size_download}\n" --output /dev/null
31032
$ curl http://example.com/ --silent -H "Accept-Encoding: gzip,deflate" --write-out "%{size_download}\n" --output /dev/null
2553
$ b b
在第二种情况下,客户端告诉服务器它支持内容编码,你可以看到响应确实更短,压缩。
In the second case the client tells the server that it supports content encoding and you can see that the response was indeed shorter, compressed.
这篇关于如何判断我的服务器是否提供GZipped内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文