Skip to content

Enable a safe way to enhance executeCacheQuery to handle cache invalidation tags #7088

@jorgerobles

Description

@jorgerobles

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:

  1. executeCacheQuery could delegate to QueryCacheProfile the persistence of the cache, as it already generate the cache keys
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions