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

WordPress Trac noreply at wordpress.org
Mon Jun 12 05:06:15 UTC 2017


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

 * status:  reopened => closed
 * resolution:   => wontfix


Comment:

 Replying to [comment:12 Ste_95]:
 > Why hasn't this received any more attention? I still think it's
 relevant.

 This was made irrelevant when WordPress removed persistent caching.
 File-based Persistent caching was removed in WordPress 2.5 and switched to
 a non-persistent per-request cache instead, which removed the need to
 clear the cache like this.

 The cache is designed to be replaced by a persistent in-memory cache such
 as memcache, redis, or any other number of cache backends. These do not
 generally allow deletion of an entire cache group, adding support to
 WordPress for it is therefor not exactly useful.

 > Why not implement the patch from @filosofo? Or at least provide a method
 to access the $cache class var, so that we could iterate through the
 category array and manually delete each key?

 While we could enable this, it would cause your code to be not-very-
 portable, as soon as you used it on any site that had an external Object
 Caching dropin enabled, you'd see the code completely fail to operate as
 expected.

 > The invalidation method posted by scribu is good with memcached, but not
 if cached data goes to the database as a transient:

 Transients are completely different to the `wp_cache_*()` functions,
 although transients do utilise them if an external cache is in use.
 If you've got `wp_cache_*()` setup through a drop-in to use transients,
 then that's probably a bad move - it's really not designed to be used like
 that, and you'd be better off with that disabled in many scenario's I
 would assume.

 You may want to look at how you're using transients if that's the case,
 and reconsider their usage. It sounds like you're using them in a way they
 weren't designed, or something similar. #20316 may interest you.

 I'm re-closing this ticket as `wontfix`, you may comment here while the
 ticket is closed, but for the reasons outlined above, we won't be adding a
 `Delete Cache by Group` functionality right now, and probably not anytime
 soon.

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


More information about the wp-trac mailing list