httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ray Van Dolson <rvandol...@esri.com>
Subject [users@httpd] mod_filter newbie
Date Mon, 29 Jun 2009 22:11:21 GMT
Hi all, I'm trying to replace some of my legacy AddOutputFilterByType
configuration directives with the more flexible dynamic syntax.

I have a reverse proxy set up in front of a server that is likely to
provide gzip compressed data.

I need to use mod_substitute to do a search and replace on the
text/html files however, so I have to ensure that I do not have a
gzip'd stream (mod_substitute can't handle this).

Old:

  RequestHeader unset Accept-Encoding
  AddOutputFilterByType SUBSTITUTE text/html
  Substitute "s|wrongtext|rightext|n"

  <Location />
    Proxy Pass ...
    ProxyPassReverse ...
  </Location>

New:

  FilterProvider gzinflate INFLATE resp=Content-Encoding $gzip
  FilterProvider replace SUBSTITUTE Content-Type $text/
  FilterProvider gzdeflate DEFLATE Content-Type $text/
  # I believe the + is not needed in my case..
  FilterChain +gzinflate +replace +gzdeflate
  Substitute "s|wrongtext|rightext|n"

  <Location />
    Proxy Pass ...
    ProxyPassReverse ...
  </Location>

Both blocks work, but I'm thinking I could potentially end up calling
gzdeflate on data that wasn't originally compressed.  Maybe someone can
clarify:

  - Does each member of a FilterChain get called regardless?  For
    example:

      text/html (uncompressed) doesn't match on the gzinflate line, but
      would one he next two.  I'd end up with compressed output that
      wasn't originally compressed.

  - If so, should I set an environment variable if Content-Encoding =
    gzip and then have my gzdeflate provider check for it instead of
    operating blindly on all text/* ?

    Or maybe some way to check if the request we're responding to had
    Accept-Encoding gzip set?

Thanks,
Ray

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message