Problem/Motivation
See notes in #3478621: Add filecache to OOP hook attribute parsing.
apcu isn't shared between cli and web processes, nor is it shared between cli processes - therefore whenever YAML (or soon attribute) parsing tries to use FileCache on the cli, it won't work.
Steps to reproduce
Proposed resolution
Add a new filecache backend, DatabaseApuFileCacheBackend which stores entries both in the database and APCu. We continue to use APCu because we have special optimisations for test running, and generally because it will reduce the number of database queries in cold start situations and places like the installer.
The backend is based on the cache subsystem's database backend, but can't re-use it because it can't be a service or rely on other services, so it's simplified a bit.
This backend is set as the fallback so all sites get the new behaviour.
Implemented garbage collection and an interface for it, because eventually something like removing a module should result in any related cache entries disappearing. This is done with a default but configurable TTL of 3 months.
It is very tempting to introduce +/- 1 month jitter to the TTL too so that caches set at the same time will expire days apart, eventually leading to an even spread, but didn't want to overcomplicate what is already a non-trivial issue.
The system cron garbage collection is the best I can come up with given we're not dealing with services.