Cache
This chapter is intended to give you a basic understanding of the Drupal cache.
Table of contents
Drupal projects discussed in this chapter: CacheExclude, Clear Cache.
Introduction
Most Drupal sites are set up to use the cache for the anonymous user.
During development, caching should be disabled. On production sites, caching should always remain enabled for best performance.
See also the Drupal.org community documentation: Caching Overview.
Cache settings
- "Minimum cache lifetime" means that pages will not be regenerated until at least this much time has passed and a cache clearing event (e.g. cron) has happened.
- "Expiration of cached pages" controls what is sent as a max-age value in a Cache-Control header.
Source: DA (Difference between Minimum cache lifetime and Expiration of cached pages.)
Production
When caching for the anonymous user is enabledBy default, a user needs the Administer site configuration permission to clear the cache. This permission is very broad.
Clear CacheFinal word
Sometimes you want all pages to be cached for anonymous users except for one or two pages that have dynamic or random or rotating content. If those pages are cached, the dynamic parts cease to be dynamic. The CacheExclude module allows an administrator to selectively exclude certain paths from being cached.
Last update: 2017-01-05 for D7 [gh].