Compressing MediaWiki css files

From FVue
Jump to: navigation, search

Problem

Half the traffic my MediaWiki generates is used by css files. The largest one - main.css - contains a lot of comments and whitespace. Would it be beneficial to compress main.css?

Solution

Compress the css using CSSTidy. These are the results:

 size [bytes]   filename                      comment
 ------------   ---------------------------   -------------------------------------
   27736        main.css.orig                 Original main.css of MediaWiki-1.11.0
   28019        main.css                      Modified with Google ads
   28019        main.css.uncompressed         Backup of main.css
   19758        main.css.compressed-high      csstidy main.css --template=high
   19506        main.css.compressed-highest   csstidy main.css --template=highest

So using csstidy results in a 30% file size reduction.

Journal

20080125

Optimize and Compress CSS Files
Good introduction page to csstidy

Comments

blog comments powered by Disqus