I've got mod_disk_cache working great in Apache. It's caching some of the requests coming out of Tomcat. But for various reasons I won't go into, we can't get Tomcat to drop the Expires and Cache-Control headers on other pieces of content. These headers are set to no-cache and 0. I need to modify or drop them, because Apache's mod_cache will not cache the content if it has those headers set.
My idea is to set up Apache to strip the headers, then forward on to mod_cache. Or if there's a way to tell mod_cache to ignore the cache-control headers, that would work too.
Two instances of Apache would do it. I'd rather just have two virtualhosts and have one proxy to another. Perhaps I can do it with just one VH. What would the config look like?
The following did not work. It strips the headers delivered to the client, but the ajp-proxied resource is not cached to disk. I think it's evaluating mod_cache first, seeing the nocache header, refusing to cache, then doing the header strip afterwards.
Header unset Expires
Header unset Cache-Control
LoadModule cache_module modules/mod_cache.so
<IfModule mod_cache.c>
LoadModule cache_disk_module modules/mod_cache_disk.so
<IfModule mod_cache_disk.c>
CacheRoot "/www/cache"
CacheEnable disk "/"
CacheDirLevels 5
CacheDirLength 3
</IfModule>
</IfModule>
ProxyPass "/myappdir" "ajp://localhost:8009/myappdir"