Cache

by Gisle Hannemyr

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 alsoSee also the Drupal.org community documentation: Caching Overview.

Cache settings

Source: DA (Difference between Minimum cache lifetime and Expiration of cached pages.)

Production

When caching for the anonymous user is enabled

By default, a user needs the Administer site configuration permis­sion to clear the cache. This permission is very broad.

Clear Cache
This project creates an administrative menu entry to clear the cache. Access is governed by its own permission. It may be used as as a replacment for the core clear cache opeartion when you want to grant a contributor the right to clear the cache without granting him or her the Administer site configuration permis­sion. No D8 release.

Final 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].