CustomCache
This module allows you to replace permanent caches with time-limited caches. This is useful for large sites to prevent the database from growing excessively large due to unlimited page caches.
πΊπ¦
This module is maintained by Ukrainian developers.Please consider supporting Ukraine in a fight for their freedom and safety of Europe.
Custom cache module adds possibility to replace permanent caches to time limited caches. It's usefull for sites with a lot of nodes, drupal generates a lot of page caches without time limit which significantly increase a DB size with time.
Installation
Install it via composer like any other drupal module and add a configuration to a settings.php
Configuration
You need to add a configuration to your settings.php:
Setup a cache time limit, as example for one day:
$settings['custom_cache_melt_time'] = 86400;
Add a cache backend service:
$settings['cache']['bins']['render'] = 'cache.backend.custom_cache';
$settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.custom_cache';
$settings['cache']['bins']['page'] = 'cache.backend.custom_cache';Exclude cids which we want to save:
$settings['custom_cache_exclude_cids'] = [
'/node/',
'/taxonomy/term/',
'/sites/default/files/',
'/user/'
];
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 1.0.2 | Stable | 8β11 | Feb 10, 2026 |