Set up Apache Httpd 2.2 to cache static contents from Weblogic / Tomcat / Jboss backend


Add below to conf.d/backend.conf

<IfModule mod_cache.c>
<IfModule mod_disk_cache.c>
CacheRoot “/var/cache/mod_proxy/”
CacheEnable disk “/”
CacheDirLevels 2
CacheDirLength 1

CacheLock on
CacheLockPath “/tmp/mod_cache-lock”
CacheLockMaxAge 5

# These only valid for Apache httpd 2.4
#CacheQuickHandler off
#CacheHeader on
#CustomLog “logs/cached-requests.log” common env=cache-hit
#CustomLog “logs/uncached-requests.log” common env=cache-miss
#CustomLog “logs/revalidated-requests.log” common env=cache-revalidate
#CustomLog “logs/invalidated-requests.log” common env=cache-invalidate



How to check:

1) Check access logs for Apache as well as the backend

2) Confirm that there are files in CacheRoot

#ls -R /var/cache/mod_proxy





Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s