On 2/6/07, Brion Vibber brion@pobox.com wrote:
I took a quick peek at the sampled squid log and found that CSS and JS files together are eating a lot of bandwidth; together they make up about 20% of what's served:
https://wikitech.leuksman.com/view/Squid_bandwidth_breakdown
(May be inaccurate due to coding mistakes in my counter or weird dupe caching effects.)
It should be possible to serve these files compressed through Apache with mod_gzip set up, which should squish them by probably 2/3.
Another option (which won't require more sysadminning or server CPU) is to compress them "manually" by stripping all whitespace and comments.
For example, looking at http://en.wikipedia.org/skins-1.5/monobook/main.css?55 it appears that comments and whitespace comprise more than 20% of the bytes in the file:
maincss.gsub(//*.*?*//m, '').gsub(/\s{2,}/, ' ').length / maincss.length.to_f
=> 0.79468590655243
You could likely do better with a real CSS parser.