"Evan Martin" evanm@google.com wrote in message news:9f43d19d0702071316k29d43f31y3a2cfe8a18d7859d@mail.gmail.com...
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.
However, that will make debugging very hard indeed. Not sure how big a consideration that is, but I know that I have often looked into the MW stylesheets to see how particular stylings are acheived when making my own css rules.
- Mark Clements (HappyDog)