Would be nice to get rid of the global $cache here.