Bug #13346


Update cache drop-in to support wp_cache_get_multiple()

Added by Boone Gorges almost 4 years ago. Updated almost 4 years ago.

Priority name:
Category name:
Target version:
Start date:
Due date:
% Done:


Estimated time:
Deployment actions:


We should update our cache drop-in to support wp_cache_get_multiple(). See It's possible that Human Made (from whom we borrowed the drop-in) has already done so.

At the same time, we should also fix/update our advanced-post-cache implementation to match. See

Related issues

Related to CUNY Academic Commons - Bug #13341: Forum reply problemsResolvedRaymond Hoh2020-09-17

Actions #1

Updated by Boone Gorges almost 4 years ago

  • Related to Bug #13341: Forum reply problems added
Actions #2

Updated by Boone Gorges almost 4 years ago

My first pass at this is in the following changesets:,

It appears that the getMulti() support in the original HM drop-in is sort of broken. It builds derived keys from the key+group combos passed to the method, and then it uses those derived keys to store the values, so that they're never found. After I figured this out, I now see that it was fixed separately by the HM folks :)

I have to step away for the moment, but I'll review in the next few days to see if it's better to merge the upstream changes before implementing wp_cache_get_multiple().

Actions #3

Updated by Boone Gorges almost 4 years ago

In I updated our implementation to the "refactor" branch of the HM repo. Neither that branch nor the master branch has been updated in several years, but the refactor branch includes the necessary fixes for getMulti(), so I went with it. The refactor branch also eliminates a huge amount of unused boilerplate code, making it easier to figure out what's going on in the drop-in.

In I re-added support for wp_cache_get_multiple(). I've run through some tests locally and on cdev (where we run the same instance of Memcached as the production site) and it appears that cache multi-fetches in WP Core are working properly.

Actions #4

Updated by Boone Gorges almost 4 years ago

  • Status changed from New to Resolved

In I updated advanced-post-cache to the bleeding edge from the GitHub repo. The main changes here are the new filters for excluding queries for certain post types from the cache.

In I made the necessary changes so that the plugin uses our new wp_cache_get_multiple(). I've tested this change and it appears to be working properly.


Also available in: Atom PDF