-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
Description
Feature Request
What
Enable a safe way to enhance executeCacheQuery to handle cache invalidation tags
Why
Cache invalidation tags are useful for expiring cache due external events, For example, invalidate cache upon recieving an event with of external modification of the database based on their table names.
Overriding executeCacheQuery method seems dangerous. Actually use $this->params that is a private property, so extending using a connection wrapper class needs implementation details that may not be of the concern of the extending class, rather than just save the cache item.
How
Ideas:
- executeCacheQuery could delegate to QueryCacheProfile the persistence of the cache, as it already generate the cache keys
- call an overridable protected function saveCache($cache,$item,$value) instead
$item->set($value);could enable use of other cache natures, as checking for tag aware $cache, and adding tags before save