On 08/23/2012 11:32 PM, Tim Bannister wrote: > On 23 Aug 2012, at 11:45, Daniel Gruno <rum...@cord.dk> wrote: >> On 08/23/2012 12:02 AM, Tim Bannister wrote: > My patch is for implementing gzip compression by httpd, not decompression, > but the code will look pretty similar. > > That's quite neat, then. I will try to make an actual implementation in Lua. > The part I found difficult was the interaction with the second > transfer-encoding, “chunked”. Using gzip Transfer-Encoding: implies using > chunked, because we want to shorten the response and this means that the > Content-Length definitely doesn't match the size of the HTTP response body. > I took a shot at an actual compression filter in Lua today, that uses zlib to deflate buckets and sends it as chunked data to the client.
The script I used can be found at http://apaste.info/OPHa and I've verified that it works well for compressing text (I compressed a 50kb html output from a Lua script down to a 5kb chunked message with 4 separate chunks due to calling r:flush() in the script) The documentation for these new filters can be temporarily found at http://www.humbedooh.com/mod_lua.html.en#modifying_buckets while I polish it off for final committing (I have a bad habit of committing stuff, then making 10 new revisions later on ;) ). I just need to finish off some final adjustments, and I'll be committing the Lua filter support to the trunk for review and nagging. With regards, Daniel.