[wp-trac] [WordPress Trac] #20875: Introduce wp_cache_get_multi()
WordPress Trac
noreply at wordpress.org
Sat Jun 11 03:19:53 UTC 2016
#20875: Introduce wp_cache_get_multi()
-------------------------------------------------+-------------------------
Reporter: nacin | Owner:
Type: enhancement | boonebgorges
Priority: normal | Status: assigned
Component: Cache API | Milestone: 4.6
Severity: normal | Version:
Keywords: has-patch has-unit-tests 2nd- | Resolution:
opinion | Focuses:
-------------------------------------------------+-------------------------
Comment (by boonebgorges):
Replying to [comment:21 rmccue]:
> I'd like to get feedback from @tollmanz and @tellyworth on this one, as
it affects a lot of caches and affects WP.com too. We may need to
introduce this without using it for alloptions in #31245 if performance of
alloptions is going to be a large concern.
>
> Definitely agreed that alloptions/multi-get shouldn't block each other.
alloptions is a very specific use case for multi-get that doesn't
necessarily fit the typical use case for it; for most uses, an iterated
single get (i.e. the fallback) isn't hugely different.
Agree 100%, especially about the last part. Functions like
`_get_non_cached_ids()` already do a bunch of separate `_get()` calls.
Switching to use `getMulti()` when available will do no harm at all in
cases when the object cache doesn't implement it.
I think the main outstanding questions here have to do with function
naming and syntax. On this point, @tollmanz's thoughts would be especially
helpful, since he originally suggested (and implemented in his own cache
backends) the more sophisticated syntax.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/20875#comment:24>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list