On this page
Using the Authcache module for improving performance for logged-in users
- Authcache 101: Intro to the Magical World of Caching
- Authcache 2 - The big picture
- Authcache 2 recipe: Upgrade to Varnish and ESI
- Authcache 2 tuning guide - avoid the database
- Authcache 2 tuning guide - integrate with Cache Expiration module
- Authcache 2 tuning guide - optimize cache-hit ratio
- Authcache 2 tuning guide - reduce number of Ajax / ESI calls
- How Authcache Ajax works
- Installing Authcache 6.x
- Modifying your Drupal theme for Authcache
- Tutorial: Commerce Kickstart 2 and Authcache 2
Authcache 2 tuning guide - integrate with Cache Expiration module
Many actions on a Drupal site trigger a flush of the entire page cache, including but not limited to (list courtesy of Brian K. Osborne):
- A node is created/edited/deleted
- A block is created/edited/deleted
- A comment is created/edited/deleted
- A vote is registered in a poll
- User profile fields are manipulated
- System theme settings are changed
- Taxonomy terms/vocabularies are manipulated
- Permissions for roles are changed
- Cron is run
Therefore when site content changes frequently, the cache hit rate will suffer. In order to prevent frequent flushes, a Minimum cache lifetime can be specified in Administration » Configuration » Development » Performance. However when this setting is too high, outdated content is served to users, which may not be acceptible under certain circumstances.
Using the Cache Expiration module it is possible to automatically remove a selected set of pages from the cache whenever content is modified. This allows for high Minimum cache lifetime values without risking that stale versions of important content is served to users.
Configure Cache Expiration
- Install the Cache Expiration module.
- Enable the Authcache Builtin Cache Expiration vX module (where X is either 1 or 2 matching the version of the installed Cache Expiration module).
- When using Cache Expiration 1.x, navigate to Administration » Configuration » Development » Performance » Cache Expiration and uncheck the option Include base URL in expires. Then save the configuration.
Settings for Cache Expiration 7.x-1.x - When using Cache Expiration 2.x, navigate to Administration » Configuration » System » Cache Expiration and set the implementation to External expiration. Adapt the rest of the settings to your needs and finally save the configuration.
Settings for Cache Expiration 7.x-2.x - Then go to Administration » Configuration » Development » Performance and max out the Minimum cache lifetime.
Performance settings, max out minimum cache lifetime
Note that with this settings the whole page cache is still flushed completely once a day. But only selected pages will be removed from the cache when content is updated or a comment is posted.
The Expire Cache module comes with Rules integration. Therefore the expiration logic can be extended in many ways. However remember to always pass internal paths to the expire-action, the Cache Expiration integration for Authcache Builtin Storage Backend does not work with full URLs.
Notes
- See #2363101-11: Anonymous cache not clearing until cookies cleared for a solution when operating the Expire Cache module in combination with Authcache Builtin Storage Backend on dual HTTP/HTTPS deployment.
- This strategy does not seem to work in combination with the Redis cache backend. See #2687011: Authcache Tuning Guide - Redis - Minimum cache lifetime must be set to none and #2538902: cache_lifetime variable causes all cache entries to expire .
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion