如何验证网页是否已被 gzip 压缩?
我计划配置 weblogic 的 gzip servlet 过滤器(使用 weblogicx-gzip.jar)来对我的网页进行 gzip 压缩。
如何验证页面是否已压缩发送到客户端?
I plan to configure weblogic's gzip servlet filter (using weblogicx-gzip.jar) to gzip my web pages.
How can I verify that the pages are being sent to the client gzipped?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
Content-Encoding
为gzip
,您会收到 GZip 格式的页面。Content-Encoding
isgzip
you received the page in GZip format.我赞同 Yslow 的评论。但为了扩展一点,YSlow 将显示正在使用 GZip 的项目以及未使用 GZip 的项目。只需转到 YSlow 插件的“组件”选项卡,它就会为您提供一个漂亮的项目列视图(见图)。
I second the Yslow comment. But to expand just a little, YSlow will show items are using GZip as well as items that are not. Just go to the Components tab of the YSlow Plugin and it will give you a nice column view of items (see image).
yslow会告诉你。至少它会告诉你它们什么时候没有拉上拉链。
yslow will tell you. At least it will tell you when they are not zipped.
对您来说快速而简单:在以下网站上在线检查:
希望有用
Fast and easy for you: Check online on below sites:
Hope it useful
该网站提供在线工具来检查
http://www.port80software.com/products/httpzip/
that site offer online tool to check
http://www.port80software.com/products/httpzip/
不确定您是否正在寻找自动方式。但 Firefox 的 Firebug 和/或 PageSpeed 扩展会告诉您哪些文件正在被 gzip 压缩。
对于 Firebug,在“Net”面板中,如果您查看文件标头,如果经过 gzip 压缩,则应该有一个“Content-Encoding: gzip”标头。
YSlow 扩展还会在一个屏幕上告诉您哪些 JS/CSS 文件经过 gzip 压缩,哪些没有。
Not sure if you're looking for a automatic way. But the Firebug and/or PageSpeed extensions for Firefox will tell which files are being gzipped.
For Firebug, in the "Net" panel, if you look at the files headers there should be a "Content-Encoding: gzip" header if it's gzipped.
The YSlow extension will also tell you on one screen which JS/CSS files are gzipped and which are not.
您可以使用 fiddler 并检查 http 标头的 gzip 编码。此外,如果您想查看压缩程度,您可以查看使用和不使用过滤器的页面大小。根据我的经验,我发现文本数据的平均压缩率为 90%。
You can use fiddler and inspect the http header for gzip encoding. Also if you want to see how much compression it did, you can see the page size with and without the filter. From my experience I have seen 90% compression on average on text data.
Google Chrome 或 Chromium 的 Web 开发工具包也可以做到这一点(与 Firebug 类似)。
Google Chrome's, or Chromium's, web developer kit can also do this (in a similar fashion as Firebug).