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

WordPress Trac noreply at wordpress.org
Fri Apr 30 12:17:59 UTC 2021


#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:  needs-patch  |     Focuses:
-------------------------+------------------------------
Changes (by dg12345):

 * keywords:  has-patch => needs-patch


Comment:

 The main reason I can think to do this is that, currently to delete
 targeted cache you must use the "last_changed" method which essentially
 just adjust the keys used but that would also leave the old keys in the
 cache, so your redis or memcache will slowly get bigger.

 The only other way is for you to keep track of all the keys used and write
 a script to delete each one when you want to delete the cache.

 I agree with @lucasbustamante, simply putting it in as an official core
 function you will force the hand of the plugin writers to implement it in
 the main redis and memcache plugins.

 I would think its a five minute job to add a delete by group function, the
 core doesn't even need to use it (although give the cache size issue it
 would be nice if it did).

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


More information about the wp-trac mailing list