Re: proposal: css compression via aliasing specification

* Barry van Oudtshoorn wrote:
>Is this not what GZIP effectively does in any case? <plug>As someone 
>who's written a CSS minifier 
>(https://github.com/barryvan/CSSMin/)</plug>, I'd be interested to see 
>what sort of reductions this approach would give over just gzipping the 
>file.

The DEFLATE format encodes literal sequences of bytes and instructions
to copy bytes, and stores them efficiently ("LZ77"). So something like

  abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz

may end up as `abcdefghijklmnopqrstuvwxyz<go back 26 bytes and copy 26
bytes>`, and the most frequent copy instructions are encoded concisely.

For structured text a fair rule of thumb is that you cannot do better
than half the compressed size of a good DEFLATE encoder, see e.g. the
results on <http://mattmahoney.net/dc/text.html>. That would mean no
more than the size of a small logo bitmap for typical web pages. We'd
most likely be better off adopting `xz` as `gzip` replacement as that
would also shrink other text resources.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 

Received on Thursday, 12 September 2013 12:52:59 UTC