You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by Weilt <gu...@gmail.com> on 2006/12/02 17:35:47 UTC
gzip bwtween apache and backend server
Hi,
Currently I'm setting up apache as a reverse proxy. The problem is I want to
make sure the content of http communication between apache and backend
server are always gzipped, even if the client browser doesn't support gzip
or doesn't send "Accept-Encoding:gzip,deflate" header. If apache gets
gzipped content from backend server and notice the original client request
doesn't contain "Accept-Encoding:gzip,deflate" header, it need to inflate
the content and send it to user.
My question is, what's the minimum effort to achieve this goal. I tried
mod_deflate, and found it always follow accept-encoding header from client.
I used gdb to trace it and found that inflate and deflate only apply to the
original request. The fake request made by mod_proxy isn't affected. Another
problem is I used "SetInputFilter DEFLATE", gdb breakpoint on
deflate_in_filter function, but it still didn't work,the content was still
ungzipped.
So how can I write a module to achieve this, what's the major points? I
have written simple input and output filters.
Thanks a lot!
gushaow
Re: gzip bwtween apache and backend server
Posted by Weilt <gu...@gmail.com>.
And how to force the proxy to send out gzipped post request to bakcend
server?
2006/12/3, Nick Kew <ni...@webthing.com>:
>
> On Sun, 3 Dec 2006 00:35:47 +0800
> Weilt <gu...@gmail.com> wrote:
>
> > So how can I write a module to achieve this, what's the major
> > points? I have written simple input and output filters.
>
> Just use the RequestHeader directive to set Accept-Encoding.
>
> A RewriteCond can check the original Accept-Encoding,
> so you know if the proxy has to uncompress it.
>
> --
> Nick Kew
>
> Application Development with Apache - the Apache Modules Book
> http://www.apachetutor.org/
>
Re: gzip bwtween apache and backend server
Posted by Nick Kew <ni...@webthing.com>.
On Sun, 3 Dec 2006 00:35:47 +0800
Weilt <gu...@gmail.com> wrote:
> So how can I write a module to achieve this, what's the major
> points? I have written simple input and output filters.
Just use the RequestHeader directive to set Accept-Encoding.
A RewriteCond can check the original Accept-Encoding,
so you know if the proxy has to uncompress it.
--
Nick Kew
Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/