#56135 closed defect (bug) (wontfix)
WP_Term_Query cache never expiring with persistent object cache
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 6.0 |
| Component: | Taxonomy | Keywords: | |
| Focuses: | Cc: |
Description
After WordPress 6.0 release and ticket:54511 in core, we’ve been hitting with issues with persistent object cache.
The keys are never expired from cache and because of ever changing cache keys on get_terms() the cache is just filling up (memory).
On a busy-ish WooCommerce site with changing terms we’re having hundreds of thousands of cached keys/items and 13+ gigs of used redis memory in a week (on a site with 2 gig database).
I’ve gone through original trac ticket, performance-team Github issue and dev-note on make, but none of them mention persistent caching anywhere.
At the moment we're forced to use WP_REDIS_MAXTTL (feature of redis-cache plugin) to force cache expiration.
Change History (5)
#2
@
3 years ago
If I may, I'd like to put in a good word for #52710 as well, which proposes a method for allowing term caching to be bypassed in scenarios like this one.
#3
@
3 years ago
- Resolution set to duplicate
- Status changed from new to closed
This can be closed as a duplicate of #57625, eh?
#5
@
2 years ago
- Resolution changed from duplicate to wontfix
This was changed in [52669] / #54511. Query caches are invalidated using different salts in the cache key. The idea is the redis / memcache would just drop the keys, if not used. However, for other types of object cache, there are a number of actions and new cache groups to help. There are all documented here.
For that reason, I don't think there is anything to do here. So I am going to mark this as wontfix.
In #4476 adding the ability to delete cache's by group is being discussed to address this scenario.
It is taking a very long time to implement as not all persistent caches have the ability to delete by group/prefix.
I think setting a TTL or
maxmemoryand an eviction policy is the best approach to this.