Loading...


Related Products


Date Published: February 10, 2022

Drupal-based site caching

The core caches in Drupal are the page and block caches. In addition, you can use Drupal modules to cache views, panels, and entities, or to cache pages for authenticated users. You can also implement 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 Disabling the Drupal cache for an explanation of why Varnish can do a better job for your website.

Page caching

The main Drupal cache is a page cache; it caches complete pages. This means that the page cache has limited value if your website (like many) personalizes each page for signed-in visitors. Even a simple personalized welcome message on a page means that the identical page is unlikely to exist in the cache and must be regenerated for each page request.

By default, Drupal doesn't enable page caching; without it, every time a user visits a page, Drupal rebuilds the page. Page caching isn't in effect for users logged in to Drupal, but you should enable page caching for any website that receives any 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.

Note

When page caching is enabled, content editors may not always see their changes immediately. This can sometimes cause confusion. You can minimize this by informing the editors of the minimum cache lifetime, allowing the editors to either clear the cache or use an edit domain.

Block caching

By default, Drupal doesn't cache individual blocks. While anonymous users will see cached blocks if you have page caching enabled, you should 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 privileges.
  2. Go to the Performance page at Configuration > Performance (site path).
  3. Select the Cache blocks check box.
  4. Click Save configuration.

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

Note for Acquia Cloud users

The Cache audit module adds a Drush command, cacheaudit, that 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, read About Drush on Acquia Cloud.

Additional caching information

For more information about caching on your Drupal website, see the Caching overview Help Center article.

Did not find what you were looking for?

If this content did not answer your questions, try searching or contacting our support team for further assistance.

Back to Section navigation
Back to Site navigation