custom_cache
209 sites
No security coverage
πΊπ¦
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/'
];