cache_get_multiple() is supposed to take $cids by reference and mutate the array to remove found keys. We're not doing this at the moment, meaning a lot of code (notably all of Ctools) things we're missing the cache all the time.
https://api.drupal.org/api/drupal/includes%21cache.inc/function/cache_ge...
I solved this by adding an array_diff() as seen in the default DrupalDatabaseCache implementation, adding it to LCache's getMultiple() method:
public function getMultiple(&$cids) {
if (empty($cids)) return;
$cache = array();
foreach ($cids as $cid) {
$c = $this->get($cid);
if (!empty($c)) {
$cache[$cid] = $c;
}
}
$cids = array_diff($cids, array_keys($cache));
return $cache;
}
Comments
Comment #2
joshk commentedComment #3
david straussBumping to "major" because this substantially hurts performance, which is the whole point of running this project. ;-)
Comment #5
david straussComment #6
david strauss