Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can i gzip-compress all my html content(pages)

Tags:

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.

like image 812
Pradeep Avatar asked Jul 23 '09 19:07

Pradeep


2 Answers

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

like image 126
Mark L Avatar answered Nov 07 '22 05:11

Mark L


Unless your server's CPU is heavily utilized, I would always use compression. It's a trade-off between bandwidth and CPU utilization, and webservers usually have plenty of spare CPU cycles to spare.

like image 32
Chris Van Opstal Avatar answered Nov 07 '22 03:11

Chris Van Opstal