httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marko Asplund <>
Subject [users@httpd] Cache configuration advice
Date Wed, 30 Apr 2008 12:37:41 GMT

I'm developing a public web site on top of a CMS product running in
Apache Tomcat. The site will have a caching Apache httpd 2.2 reverse
proxy in front of Tomcat.
Since my experience with caching Apache reverse proxy setups is limited
I'd appreciate any feedback on the current setup plan.

Page content will be cached with Apache using ´╗┐mod_cache and
mod_disk_cache. ´╗┐Certain parts of the URL space contain non-cacheable
Page content should be cached for 5 minutes and images for 1 hour.
Several pages contain paged lists of data (e.g. news items). Paging
state is passed in HTTP request parameters and also paged content should
be cached. The backend system doesn't set any HTTP cache related headers
such as the Expires header when a page is served.
For usage statistics gathering purposes page content should not be
cacheable neither in the browser nor in any intermediate forward
proxies, if possible.

Below is the configuration file draft I've come up with.
Does the setup fulfill the requirements above?
Any other comments?

As far as I've understood the below setup would not correctly cache
request content when using request parameters (requires Expires header).
What would be the best way to fix this?

How will the Cache-Control and Expires (ExpiresByType) work together?

Is it possible to have the cache asynchronously update cached content so
that the last request would be served with expired content but behind
the scenes the cache would update the content once expired content is

  ProxyPass / ajp://

  # cache content by default for 5 minutes
  <Location />
    Deny from all
    Header set Cache-Control s-maxage=300

  # allow access to certain subspaces only
  <Location /mysite/>
    Allow from all

  CacheRoot /opt/mysite/httpd/cache
  CacheEnable disk /

  # disable caching for certain parts of the URL space
  CacheDisable /comment/
  <Location /mysite/comment/>
    Header set Cache-Control no-cache

  CacheIgnoreNoLastMod On
  CacheIgnoreHeaders Cookie

  # cache images for one hour, browser caching allowed
  ExpiresActive On
  ExpiresByType image/gif "now plus 1 hours"
  ExpiresByType image/jpeg "now plus 1 hours"
  ExpiresByType image/png "now plus 1 hours"
  ExpiresByType text/css "now plus 1 hours"

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