On 2012-08-19 19:19, Scott Reynolds wrote:
> Looking to get gzip running. Looked at the code at length last night
> to figure out where it seems to fit. It was mentioned back here:
> http://librelist.com/browser/mongrel2/2011/8/12/feature-requests-gzip-and-redirection/
> but no real details on how Zed was planning on implementing.
> 
> I did run across a photon based site that was delivering gzipped
> files. So it is possible.

Note that Photon gzip at the handler level. As Mongrel2 is fast enough,
even the assets are delivered by the handlers. I am using the same
approach than Django to gzip (a middleware).

loïc

> Filters don't strike me as the right place for that. Filters strike me
> as the spot to do HTTP caching. Though it does have access to the
> pending responses in the deliverRing, so perhaps it can modify the
> responses there?
> 
> I tried looking into doing it in Connection_deliver_raw_internal, but
> conn->req had empty headers, so Request_get doesn't return the
> 'accept-encoding' header. Seems that this line is responsible? Not
> sure what this is really doing.
> 
>     // we don't need the header anymore, so commit the buffer and deal
> with the body
>     check(IOBuf_read_commit(conn->iob,
> Request_header_length(conn->req)) != -1, "Finaly commit failed
> streaming the connection to http handlers.");
> 
> I know it is possible to do the gzipping with your handler, but what I
> want is the Mongrel2 to gzipping CSS and JS. I feel like I am missing
> something, so this email is my call for help. How do I get my Dir
> handler to deliver gzipped files.
> 

-- 
Dr Loïc d'Anterroches
Founder Céondo Ltd

w: www.ceondo.com       |  e: [email protected]
t: +44 (0)207 183 0016  |  f: +44 (0)207 183 0124

Céondo Ltd
Dalton House
60 Windsor Avenue
London
SW19 2RR / United Kingdom

Reply via email to