httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <>
Subject Re: [users@httpd] mod_proxy, mod_cache and set header
Date Wed, 13 Jul 2011 20:18:24 GMT

On 13 Jul 2011, at 20:40, Tim Watts wrote:

> Hi all,
> Quick pointer would be most welcomed:
> I have mod_proxy_http in use to front-end a tomcat server.
> Sadly the tomcat programmers omitted to set cache control headers (eg Expires) and the
tomcat servers are being overloaded, despite the content being totally invariant. I don't
"do" JSP so messing about at that end is out for me.

If the contents are invariant then, um, does it really Expire?
Last-Modified, Cache-Control and Etag may be more useful.

> So I'd like to shove a cache in front - and an agressive one at that, that handled GET
requests too.
> I normally use mod_cache_disk for this with good effect but the lack of Expires (etc)
headers are falling foul.
> I have considered an output filter to force the headers in as mod_headers does not seem
to play nice with mod_proxy.

Where's the problem?  mod_headers doesn't care whether it's in a proxy
(though it's possible mod_proxy is suppressing it - haven't looked of late).

> Is it at all likely that I could get mod_ext_filter (IIRC), mod_cache and mod_proxy to
play nice?

mod_ext_filter won't do anything for your headers.

> Next option is to hack mod_proxy (there was a 1.3 patch that allowed manipulating output
headers) - would that play nice with mod_cache?

1.3 mod_proxy made no attempt to support HTTP/1.1 - which makes it pretty-much
useless for cacheing.

> I do have Squid as a fallback - or I suppose a separate Apache instance - but it's getting
a bit hairy and overweight. A light solution would be good - I have a 100+ servers I could
usefully apply this too :)
> Any suggestions would be cool - I'm happy to graft, but as long as I start in the right
direction :)

mod_headers seems the obvious hack to fix it.  If there's a specific problem with it,
why not ask here - maybe you have a feature request?

Nick Kew

Available for work, contract or permanent

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message