- Issue created by @joachim
This is really confusing:
class StaticCache extends DatabaseBackend implements StaticCacheInterface {
Core's DatabaseBackend is a cache backend implementation. Classes that extend it or implement CacheBackendInterface should be other types of backend -- memory backend, file backend, etc.
But that's not what the StaticCache class is doing at all. It's using DatabaseBackend's methods for storage and retrieval, and adding some functions with Tome application logic that work with cached data.
Also, the name 'static' is really confusing here -- it's not a static cache, it's cached in the DB. It's a record of which site paths have been exported to the static copy of the site.
What this should actually be is two things:
1. A cache bin.
2. A service which injects that cache bin.
A cache bin is just defined in services.yml like this:
cache.entity:
class: Drupal\Core\Cache\CacheBackendInterface
tags:
- { name: cache.bin }
factory: ['@cache_factory', 'get']
arguments: [entity]
You then inject it into a service, which makes the calls to $this->cache->get() etc.
Active
1.0
Tome Static