---
title: "Managing Large Cache Render tables in Drupal 8"
date: "2025-02-05T23:11:30+00:00"
summary:
image:
type: "article"
url: "/acquia-cloud-platform/help/93856-managing-large-cache-render-tables-drupal-8"
id: "2983a190-29cb-4d8e-98cb-1bfac3b422d1"
---

Table of contents will be added

Issue
-----

On Drupal 8 sites running versions prior to 8.4.0 the `cache_render` table and overall database may rapidly increase in size, filling your disk.

Cause
-----

Drupal 8 introduced a robust and thorough caching API. Render caching is enabled by default for many elements such as pages, entities, blocks, and views. Items in this cache do not currently expire. Prior to 8.4.0, a core bug ([https://www.drupal.org/node/2526150](https://www.drupal.org/node/2526150)) may have caused the cache\_render table to rapidly increase in size.

Resolution
----------

Upgrade to the latest version of Drupal core.  If this is not possible, follow one of the other mitigation options below.

Other Mitigation options
------------------------

Important

Drupal core versions prior to 8.4.0 are currently unsupported. Versions of Drupal core prior to 8.4.5 contain a security vulnerability, announced in [SA-CORE-2018-001](https://www.drupal.org/SA-CORE-2018-001). Acquia strongly recommends that Drupal core be updated to this version to minimize the risk of security vulnerabilities on your site.

If you cannot upgrade to the latest version of Drupal core you may have to manage the `cache_render` table size manually. This may also be the case if you installed Drupal prior to 8.4 and still have a large `cache_render`  table. 

*   Occasionally truncate the `cache_render` table
*   Selectively delete items from the cache\_render table based on created date

### Truncate the cache\_render table

From a MySQL prompt, type: 

    truncate table cache_render;

### Selectively delete items from the cache\_render table based on created date

From a MySQL prompt, type `SELECT COUNT(expire) as 'EXPIRE' from cache_render WHERE created < 'TIMESTAMP';` where timestamp is the date in Unix Epoch time. Here are two options for getting "yesterday" in Epoch time (choose one):

    date -v -1d +'%s'
    expr `date +'%s'` - 86400

It's always good to get an idea of the rows involved:

    SELECT COUNT(expire) as 'EXPIRE' FROM cache_render WHERE created < '1491593775';
    +---------------+
    | count(expire) |
    +---------------+
    |         27022 |
    +---------------+

From there, you can modify the timestamp or delete the rows. Here's the command to delete all rows from `cache_render` earlier than a specific date:

    DELETE FROM cache_render WHERE created < 'TIMESTAMP';