Skip to main content
Last Reviewed: December 13, 2022

Caching in Drupal Views

Configure your Drupal site's performance and caching settings to make significant improvements.


While configuring Drupal's performance and caching settings and using Object Cache will make a significant performance difference, not every module uses Drupal's caching out of the box.

Views

Views has a very granular caching system, down to the individual View display. There's no single control that will just turn on views caching, and the caching is off by default. There are three different kinds of user-configurable caching within Views:

Query Results Caching

Raw Query Results, which should be cached for at least 1 minute. As the subject matter expert, you're in the best position to know how often your content should change.

Rendered Output Caching

Generated markup, which should be cached for as long as possible (if the query changes, the output will be refreshed).

Block Caching

If you're generating a block, this will expose the block to Drupal's built-in block caching.

Configure Views Caching

  1. Go to /admin/structure/views/

  2. Edit the View in question.

  3. Select the display and click Advanced.

  4. Click the option next to Caching.

  5. Choose Time-Based Caching and click Apply.

    Rendered output: (something other than Never Cache)

    Query results: (something other than Never Cache)

Configure Views Block Caching

  1. Go to /admin/structure/views/
  2. Edit the View in question.
  3. Select the block display and click Advanced.
  4. Click the option next to Block Caching.
  5. Block Caching Type: Choose an option for Drupal's built-in block caching method.

Views Caching Modules

Drupal 7

You can force caching for all your views using a module like Views cache bully.

Drupal (Latest Version)

You can replace the hard-coded cache tag with a form that allows developers to set different cache tags based on configuration of the view using a module like Views Custom Cache Tags.

Info:
Note

Drupal 8 reached end-of-life status in November 2021, and is no longer supported by Drupal. Read the official announcement on Drupal.org.