Bigsmallbig.

Thanks in part to a nudge from Mark Pilgrim, and in part to a smart little PHP class (long since disowned by its author) [see below], the documents on this site are now served gzip compressed (at sizes reduced as much as 75%) to browsers which can handle such data, which I believe is most, though I’m not sure, but I’m fairly sure that browsers which cannot handle such data are sent a plain uncompressed file. I would ask for reports of decompression errors, but if there were any decompression errors the request wouldn’t be visible; such is the nature of compression. If you can read this it works.

UPDATE: Anyone with a recent version of PHP (4.1+) running on their server can easily take advantage of this. Benefits are greatly reduced bandwidth consumption and a much speedier site, especially for readers using modems. Simply place the following snippet at the very first line of PHP-aware web pages, before :

Test here. Potential problems and solutions:

  • If no compression is happening and you can see the code snippet when you View Source on your page, this means the page is not PHP-aware. Create a text file in your root directory called .htaccess and paste the following inside it:
    AddType application/x-httpd-php .html .htm
  • If no compression is happening and you can’t see the code snippet when you View Source, chances are your server’s version of PHP was compiled without the gzip library. Confirm this with your server admin.
  • If you get the error message "output handler 'ob_gzhandler' cannot be used twice", your pages are already being compressed. Felicitations.

[Textism]