[wp-trac] [WordPress Trac] #4476: Delete Cache by Group

WordPress Trac noreply at wordpress.org
Tue May 26 18:00:09 UTC 2020


#4476: Delete Cache by Group
-----------------------------+------------------------------
 Reporter:  filosofo         |       Owner:  (none)
     Type:  enhancement      |      Status:  reopened
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Cache API        |     Version:  2.2
 Severity:  normal           |  Resolution:
 Keywords:  has-patch close  |     Focuses:
-----------------------------+------------------------------

Comment (by lucasbustamante):

 It would be nice if WordPress could enforce an object-cache API that the
 drop-ins could follow so we could use it reliably in plugin development.

 For instance, Pantheon's Redis drop-in supports deleting a group of cache
 keys with `wp_cache_delete_group( $group )`:

 https://github.com/pantheon-systems/wp-redis/blob/master/object-
 cache.php#L98
 https://github.com/pantheon-systems/wp-redis/blob/master/object-
 cache.php#L547

 While this other Redis drop-in with 60k+ installations does not:
 https://wordpress.org/plugins/redis-cache/ (https://github.com/devgeniem
 /wp-redis-object-cache-dropin/blob/master/object-cache.php)

 Automattic WP Memcached doesn't support groups, either:
 https://github.com/Automattic/wp-memcached/blob/master/object-cache.php

 The solution I propose is that WordPress enforces an interface on cache
 drop-ins, so we can be sure that they will allow deleting groups. If
 Memcached needs some namespace hacks to work with groups, then that's
 handled internally by the drop-in.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/4476#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list