This guy did a not so rigorous analysis but it is mostly OK: http://changelog.complete.org/archives/931-how-to-think-abou...
A little bird told me there's a better algorithm in speed/compression rate coming soon ;)
Using 50MiB from a tarball I had lying around, best of 3:
prog time(s) size(%)
gzip -1 1.703 38.7
gzip -9 14.670 35.1 (worse than xz -1)
bzip2 -1 7.714 34.0
bzip2 -9 8.035 31.4 (worse than xz -1)
xz -1 6.278 31.3
xz -9 42.445 22.7 (best compression)
lzop -1 0.670 46.1 (fastest)
lzop -9 18.144 38.0I'm insisting because PAQ is a really incredible collection of compressors. Far more intelligence in it than in the LZ* bunch.
http://partiallystapled.com/~gxti/misc/2010/06/25-shootout.p...
http://partiallystapled.com/~gxti/misc/2010/06/25-linux-2.6....
xz format seems to have this feature, but: $ xz --list xz: --list is not implemented yet.
EDIT: also, like gzip but unlike bzip2, you can stream data through xz (at an insignificant penalty in compression ratio).
Right now, CPUs are fast enough that LZMA is a realistic prospect. It boils down to what the extra CPUs will cost vs the cost of the storage saved (incl. the "cost" of space in the datacentre, the administrative overhead of more hardware, etc).
This could be achieved by using Javascript and fetching data as JSON, but it seems to be something that would be very useful and beneficial if it were standardized.
Really expensive algorithms aren't that much better to offset cost of sending template logic to the client.
You could probably save some processing time by integrating compression directly into server-side templating - take advantage of the fact that some parts never change and keep them pre-compressed or at least cache some statistics about them to aid compression.
The server supplies a pre-created dictionary (template) which gets cached, and further requests get a diff to that dictionary as a response.
I've only found Google search using it on the server side, and the browser penetration is fairly low, but it seems promising. It makes requests very fast.
I've also noticed that Google search serves image thumbnails as data:// URLs directly in the original response. They are going a long way to ensuring each page loads entirely in one request.