Apache2 mod_proxy, mod_rewrite and mod_cache

apache-2.2mod-cachemod-proxymod-rewrite

I have frontend apache2 and backend tomcat6 with apache lenya.

Proxy works fine but I want to cache images.

Here is my simple config:

ProxyPass / http://192.168.0.82:8888/
ProxyPassReverse / http://192.168.0.82:8888/


RewriteRule ^/$ index.html [R]
RewriteRule ^/default/live/(.*)$ $1 [R,L]
RewriteRule ^/(.*) http://192.168.0.82:8888/default/live/$1 [P]

ProxyRequests Off
RewriteEngine On

and I tried to cache it in this way:

<IfModule mod_disk_cache.c>
CacheEnable disk /
CacheRoot "/var/cache/mod_proxy"
CacheRoot /home/apache2/cache
CacheDefaultExpire      60
CacheMaxExpire          3600
</IfModule>

But I got nothing…

I even tried this way:

<IfModule mod_mem_cache.c>
CacheEnable mem /
MCacheMaxObjectSize 1024000
MCacheSize 102400
</IfModule>

again without results.

mod_mem_cache and mod_disk_cache enabled.
So I don`t know where the problem is…
Could you help me, please?

Best Answer

For starters: you have a double entry for the CacheRoot.
Check out this page Some Tuning Tips For Apache Mod_Cache (mod_disk_cache) for some deeper information.

Related Topic