Move parts of the cache API to component

Created on 2 March 2024, 6 months ago
Updated 25 July 2024, about 1 month ago

Problem/Motivation

Drupal's cache API is best-in-class, we have possibly the only cache tags implementation that works cross-storage and scales (e.g., laravel doesn't support arbitrary cache tags at all, php-cache stores all cache invalidations in a giant array). However it's not possible to use the cache API without the rest of core.

Steps to reproduce

Proposed resolution

Move all the parts that make sense to Drupal\Component\Cache - this will be most things except the database implementation.

We can't move the database backend because the database layer also isn't a component, but that could happen if and when it ever does, until then it can just stay in Drupal\Core.

Once it's in a component, someone could write a PSR-6 adapter to allow using our backends like redis and memcache with other frameworks.

If it's never used by anyone outside core, then the worst we've done is changed some namespaces around and made dependencies more explicit.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component
Cache 

Last updated 1 day ago

Created by

🇬🇧United Kingdom catch

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024