我可以压缩所有的html内容(页面)吗? [英] Can i gzip-compress all my html content(pages)

查看:157
本文介绍了我可以压缩所有的html内容(页面)吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找出是否有定义哪些页面应该被gzip压缩并且在发送纯html内容时画出一条线的原则。

如果您可以分享您在gzip-compressing项目的一部分中所做的决定,这将会很有帮助。

解决方案

一个好主意是基准测试,数据下降速度有多快。它的压缩程度如何。如果发送从200K到160K的东西需要5秒钟,那可能不值得。服务器端的压缩成本很高,如果服务器忙碌,这可能不值得。



大部分情况下,如果您的服务器负载低于0.8定期,我只是gzip所有不像jpegs,pngs和zip文件的二进制文件。



这里有一个很好的写法:



http://developer.yahoo.com/performance/rules .html#gzip


I am trying to find out if there are any principles in defining which pages should be gzip-compressed and to draw a line when to send plain html content.

It would be helpful if you guys can share the decisions you took in gzip-compressing a part of your project.

解决方案

A good idea is to benchmark, how fast is the data coming down v.s. how well compressed is it. If it takes 5 seconds to send something that went from 200K to 160K it's probably not worth it. There is a cost of compression on the server side and if the server gets busy it might not be worth it.

For the most part, if your server load is below 0.8 regularly, I'd just gzip anything that isn't binary like jpegs, pngs and zip files.

There's a good write up here:

http://developer.yahoo.com/performance/rules.html#gzip

这篇关于我可以压缩所有的html内容(页面)吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆