Having tried and failed to get a manual implementation of chunked Transfer-Encoding with gzipped Content-Encoding working in PHP, I'm now back to using mod_deflate in Apache, which does a nice job.
Only problem is, there are some footers I'd like to send along with the reply (say, Last-Modified or ETag, so I can 304 requests for the same content). The HTTP 1.1 spec provides for footers (just like headers, only they come last) in chunked responses - but PHP doesn't seem to offer the functionality.
Possible?
(The manual implementation was great - except I'm no gzip master and the various zlib funcs PHP provides don't include one that creates valid gzipped chunks. I managed to get it working ~50% of the time - but the other 50% would break. Doh!)