lscache_wp
lscache_wp copied to clipboard
Implement wp_cache_get_multiple.
See https://make.wordpress.org/core/2020/08/11/introduce-wp_cache_get_multiple/
Hi, so is it already implemented?
Seems that the compatibility shim mentioned in that post may cover it for now.
"95% of the performance-related problems that users report on a regular basis (aside from using Redis data structures incorrectly)" can be addressed by implementing pipelining (which I assume wp_cache_get_multiple()
is for) & reusing Redis connections (already implemented) https://redislabs.com/ebook/part-2-core-concepts/chapter-4-keeping-data-safe-and-ensuring-performance/4-6-performance-considerations/
Any update on this?
Hi, so is it already implemented?
Hi @priard - yes, this is available in WP core since 5.5.
Here is a write up on the importance of this function.
https://xwp.co/easy-performance-wins-with-opt-in-caching-improvements/
Any chance this could be in an upcoming release? @hi-hai @tynanbe
It already is, @spacedmonkey :slightly_smiling_face: https://github.com/litespeedtech/lscache_wp/blob/master/src/object.lib.php#L178
@tynanbe No it's does not 😄
Look here
https://github.com/litespeedtech/lscache_wp/blob/d1a0aef92424d1c32886f4d594e094ade141d6ad/src/object.lib.php#L834-L842
All this does, it loops through the array of elements one at time. You get no benefit to doing this. And it basically what is already in core. For memcached you need to use the method getMulti like this example or Redis use MGET ( passing multiple keys ) like this example. Getting more keys at once, saves lots time going backwards and forth between the object cache server.
Worth reviewing this article and see the benefits of doing this.
While looking into this, it would also be nice if you could add wp_cache_supports
function to your code base as well. This was added https://github.com/WordPress/wordpress-develop/commit/832b6c35f36d5f1ca84feadc49b0e5424af0ad6c in WP 6.1. See this article for more details.
While looking into this, it would also be nice if you could add
wp_cache_supports
function to your code base as well. This was added WordPress/wordpress-develop@832b6c3 in WP 6.1. See this article for more details.
https://github.com/litespeedtech/lscache_wp/blob/master/src/object.lib.php#L322