Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Context Cache is module which lets you control caching and expiration through Context. For example, for one content type you can set its cache for two hours while for another content type you can set it for 30 minutes. In another use-case you can set an expiration of five minutes for the homepage and 30 minutes for any page in the news section. In case you use an external cache this module sets the proper headers for expiration.
Requirement
- Context module, version 3.x, http://drupal.org/project/context
- Chaos tools which is required by Context, http://drupal.org/project/ctools
Installation
- If using Drush, "drush dl context_cache" and then "drush en context_cache" otherwise unpack, place and enable just like any other module.
- Navigate to Administration » Configuration » Development » Performance (admin/config/development/performance) and make sure page cache is enabled if you're looking to control your Drupal cache with this module. If you are using an external cache you don't need to enable page caching.
- Navigate to Administration » Structure » Context (admin/structure/context) and click on a context or create a new one. Under Reactions the Add Reaction pull-down menu will give you a new option, Cache.
- Add the Cache reaction to a context. The "Internal" option controls Drupal's page cache and the "External" option sets the proper headers for an external cache, while "Disabled" disables page caching and sends strict headers to prevent caching (no-cache/must-revalidate). The Cache Lifetime field lets you select the duration of the cache, internal and external.
Project information
- Module categories: Performance
- 11 sites report using this module
- Created by geraldmelendez on , updated
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
7.x-1.0
released 25 May 2013
Works with Drupal: 7.x
✓ Recommended by the project’s maintainer.
Development version: 7.x-1.x-dev updated 25 May 2013 at 00:43 UTC