Opened 18 months ago
Last modified 8 months ago
#56060 new enhancement
Implement wp_cache_replace_multiple() – and related WP_Object_Cache method
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | |
Component: | Cache API | Keywords: | 2nd-opinion needs-patch |
Focuses: | performance | Cc: |
Description
See also: https://github.com/WordPress/wordpress-develop/pull/2018#discussion_r799643985
🫠
I would like to replace multiple values in a cache, but not add
or set
them if they do not exist.
In my experience and understanding, replace()
doesn't get much love because _exists()
may be impossible to implement in certain backends – specifically (or especially) when $group
is empty.
My current situation is essentially juggling multiple backends, and only wanting to replace multiple values if they exist on one server and not add or set them until some other unrelated things happen.
I went to call wp_cache_replace_multiple()
and thought my IDE had deceived me when it wasn't autocompleting. Alas! Alas, I say!
I can handle this In my own drop-in, and I can account for it in my own codes, but I think perhaps it's worth reconsidering this in core for the sake of parity with everything else.
Thoughts?
@tillkruess You interested in this one?