Information for: DEVELOPERS   PARTNERS

Drupal-based website caching

The core caches in Drupal are the page and block caches. You can use Drupal modules to cache views, panels, and entities, or to cache pages for authenticated users. You can also install caching in custom code, using the Drupal Cache APIs.

On Acquia Cloud, you may not want to use Drupal’s stock caching mechanisms for everything. See Using Varnish for an explanation of why Varnish® can do a better job for your website.

Page caching

The main Drupal cache is a page cache, caching complete pages. The page cache has limited value if your website personalizes each page for signed-in visitors. Even an easy-to-use, personalized welcome message on a page means the identical page is unlikely to exist in the cache and must regenerate for each page request.

By default, Drupal does not enable page caching; without caching, every time a user visits a page, Drupal rebuilds the page. Page caching is not in effect for users logged in to Drupal, but you must enable page caching for any website receiving anonymous traffic.

To enable page caching, see the instructions for Configuring Drupal cache settings for Varnish.

For greater detail on Drupal page caching mechanisms, see How Drupal page cache works and BigPipe and Acquia Cloud.

Note

When you enable page caching, content editors may not always see their changes right away, causing confusion. You can curb caching behavior by informing the editors of the Minimum cache lifetime, allowing them to either clear the cache or use an edit domain.

Block caching

By default, Drupal does not cache individual blocks. Although anonymous users will see cached blocks if you have page caching enabled, you must enable block caching on all websites to speed up page browsing for logged-in users.

  1. Sign in to your website using an account with administrator permissions.
  2. Go to the Performance page at Configuration > Performance (site path).
  3. Select the Cache blocks checkbox.
  4. Click Save configuration.

If your website has some blocks preventing you from enabling block caching, consider the AJAX Blocks module.

Note for Acquia Cloud users

The Cache audit module adds a Drush Command, cacheaudit, you can use from the command line to check the cache settings of common Drupal modules, including Drupal core, blocks, and Views. For more information about Drush, see About Drush on Acquia Cloud.

More caching information

For more information about caching on your Drupal website, see Caching overview.