Logo Knowledge
  • Product Documentation
  • Insight
  • Developer Center
  • Training
  • Submit a Request
  • Product Documentation
  • Insight
  • Developer Center
  • Training
  • Submit a Request
  1. Acquia Support Knowledge Base
  2. How-To
  3. Best Practices

Views caching

    See more
    • Updated
    • July 05, 2020 14:11

    Issue

    Can you explain how to set up Views caching?

    Resolution

    The Views module is a query builder; any view that it creates queries your database one or more times. This can result in multiple database queries for any given page load. By default, Views doesn't cache any of its queries or data. While Drupal's page caching will mask some of the problem, websites with a large amount of traffic coming from authenticated users will see heavier load unless you cache the Views.

    Setting up Views caching

    You can start caching your Views by setting up time-based caching on any View that will be seen regularly.

    To set up caching for a View, complete the following steps:

    1. Sign in to your website, and then go to Structure > Views 
    2. Find the view that you want to configure, and then click its Edit link.
    3. In the Advanced settings section, click None next to Caching.
    4. Select Time-based, which gives you the opportunity to cache query results or rendered output.
    5. Click Apply to save the new caching value.
    6. Click Save to save the edits to your view.

    You need to consider settings individually per View. Even a five-minute cache can make a significant difference in website performance. A blog post on Optimizing Drupal Views the Right Way offers several suggestions for Views caching.

    If you need more control over when the cache for each View is cleared, and do not want to set up the Rules and Acquia Purge modules to clear caches based on Rules, look into the Views content cache module to set up per-View cache clears when content of certain types is added to the database.

    Additional caching information

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

    More Information:

    Caching in Drupal Modules

    Topics

    • best practices
    • cache

    Drupal Projects

    • views
    • views_content_cache
    • rules
    • acquia_purge

    External Links

    • Optimizing Drupal Views the Right Way
    • Caching overview
    • Configure Views caching
    Avatar
    Stacy Wray
    • July 05, 2020 14:11
    • Updated
    • Facebook
    • Twitter
    • LinkedIn

    Was this article helpful?
    2 out of 2 found this helpful

    Return to top

    Related articles

    • How to fix slow queries
    • Panels caching
    • Tools for parsing a slow query log
    • Analyzing Your Traffic
    • How to set a unique hash_salt for an individual site in Site Factory

    Support

    Acquia Support Knowledge Base
    • Submit a Request
    • Contact Support
    • Acquia Support Guide
    • Product Documentation
    • System Status

    About Acquia

    • About Us
    • Leadership
    • Board of directors
    • Newsroom
    • Careers
    • Customers
    • Contact Us
    53 State Street, 10th Floor
    Boston, MA 02109
    United States
    Phone: 888-922-7842
    Map: Google Maps
    View other locations
    • Feeds
    • Legal
    • Security Issue?

    Copyright © 2018 Acquia Inc. All Rights Reserved. Drupal is a registered trademark of Dries Buytaert.