httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Przemek Czerkas" <>
Subject {PATCH 1] Reverse proxy IIS with gzipped disk cache
Date Sat, 13 Nov 2004 18:05:12 GMT
Hi all,

I needed to reverse proxy IIS (with modified FlatCompression ISAPI filter, which dont cache),
cache it on disk and uncompress for clients that dont Accept-Encoding: gzip. I've finally
managed to set up all these mods together. Suprisingly it works w/o mod_rewrite and SetEnvIf.
Here's my httpd.conf:

# - reverse proxy gzipped data from IIS
# - disk cache it
# - inflate for clients not sending `Accept-Encoding: gzip` header
# Based on fact (bug?), that when request is served from cache (quick_handler)
# the config directive `RequestHeader set Accept-Encoding "gzip,foobar"' 
# is overriden by client's Accept-Encoding request header.
# Side effect: not yet cached response data goes out uncompressed.

LoadModule headers_module modules/
LoadModule deflate_module modules/
LoadModule filter_module modules/
LoadModule cache_module modules/
LoadModule disk_cache_module modules/

RequestHeader set Accept-Encoding "gzip,foobar"
Header echo Accept-Encoding

FilterDeclare my_filter1 CONTENT_SET
FilterProvider my_filter1 INFLATE req=Accept-Encoding $foobar
FilterProvider my_filter1 INFLATE req=Accept-Encoding !$gzip
FilterChain my_filter1

CacheRoot c:/apache2/cache
CacheMinFileSize 0
CacheMaxFileSize 256000
CacheEnable disk /
CacheDirLevels 2
CacheDirLength 2

ProxyPreserveHost On
ProxyPass /
ProxyPassReverse /

I also needed to patch mod_cache.c to initialize output filters and properly handle redirects
from backend. Here's the patch:

Przemek Czerkas

View raw message