How can I diagnose cache misses when using Apache as a reverse proxy?
Posted
by johnstok
on Server Fault
See other posts from Server Fault
or by johnstok
Published on 2010-03-16T15:39:04Z
Indexed on
2010/03/16
15:41 UTC
Read the original article
Hit count: 257
I have set up Apache 2.2 as a reverse proxy with the following configuration:
# jBoss proxying
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /foo http://localhost:9080/foo
ProxyPassReverse /foo http://localhost:9080/foo
ProxyPassReverseCookiePath /foo /foo
# Reverse proxy caching
CacheEnable disk /foo
# Compression
SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE\s(7|8) !no-gzip !gzip-only-text/html
DeflateCompressionLevel 9
Header append Vary User-Agent env=!dont-vary
However, in a number of cases where I expect a cached response to be returned the request is sent through to the origin server at localhost:9080. Responses have a HTTP Vary header of 'Accept-Encoding,User-Agent' which is to be expected given the mod_deflate configuration.
How can I determine why Apache is unable to serve a response from the cache?
© Server Fault or respective owner