Configuring Apache to Cache Static Content via mod_disk_cache
To improve performance of a large Confluence site, we recommend that you move the caching of static content from the JVM into Apache. This will prevent the JVM from having a number of long running threads serving up static content.
Note: This page documents a configuration of Apache, rather than of Confluence itself. Atlassian will support Confluence with this configuration, but we cannot guarantee to help you debug problems with Apache. Please be aware that this material is provided for your information only, and that you use it at your own risk.
Configuring Apache mod_disk_cache
To configure Apache to cache static Confluence content:
mod_disk_cachestanza to the virtual host configuration:
Configure Apache to load
mod_disk_cache. For example, in our server configuration this is done in
- Restart Apache after both modifications are complete.
- Please refer to the Apache documentation for mod_disk_cache.
- If you encounter problems where users are served stale content, you may need to purge the Apache cache directory (
/var/cache/mod_proxyin the above configuration) after a Confluence or plugin upgrade. This is a simple 3 step process:
- Shut down Apache.
- Clear the cache directory. For example:
sudo rm -r /var/cache/mod_proxy/*
- Restart Apache.
Ensure that you are running the
htcachecleandaemon in order to prevent excessive use of disk space. In our situation we ran it like this:
This will purge content once the cache reaches 512M every 30 minutes. See the Apache documentation for htcacheclean for details of the options.
Was this helpful?
Thanks for your feedback!