A cache backend for Drupal to split cache items in separate backends., (*1)
composer require derhasi/cache_split:dev-master
cache_split
module (e.g. drush en cache_split
)render
) in your settings.php
<?php $settings['cache']['bins']['render'] = 'cache.backend.split'; ?>
<?php $settings['cache_split']['render'] = [ //.. ];
See Configuration below for details., (*2)
The configuration for a cache bin has to be defined in the settings.php:, (*3)
<?php $settings['cache_split']['NAME_OF_CACHE_BIN'] = [ //.. ];
Each bin can hold multiple matcher definitions, each may consists of:, (*4)
backend
: Name of the cache backend service to use (e.g. cache.backend.database
).
If not given it defaults to the key of the definition.includes
: Array of cid patterns this backend should be used for. If this is
empty all cids are included (except those excluded by excludes
).excludes
: Array of cid patterns this backend should not be used forA cid pattern may use *
to match any number of arbitrary characters., (*5)
A fallback backend can be defined by simply omitting includes
and excludes
or
leaving them empty., (*6)
Make sure the fallback backend is defined last, so the other definitions are considered., (*7)
In case no fallback backend is specified, cache.backend.database
is set as default., (*8)
<?php $settings['cache_split'] = [ // Splits render cache in multiple backends. 'render' => [ // Do not cache render results for paragraphs, as they are only rendered in // context of the host entity. [ 'backend' => 'cache.backend.null', 'includes' => [ 'entity_view:paragraph:*' ], 'excludes' => [], ], // Falls back to database backend. [ 'backend' => 'cache.backend.database', ], ], ]; ?>