Thursday, November 29, 2007

Comet with Apache

I’ve been mucking around with Comet, and ran into a situation which I couldn’t seem to find a solution on the lazyweb for. The problem was that none of the streamed JavaScript code blocks would be executed until the entire page was loaded.

I tracked it down to the gzip encoding module, which waits for all the data to be output, compresses it and sends it on to the browser.

You can disable gzip encoding for a particular directory in a .htaccess file (with Apache) like this:
RemoveOutputFilter DEFLATE
SetEnv no-gzip