am efe273f2: Part of fix for bug 5523834, backporting cache fixes

* commit 'efe273f2861c2ea723aa1f9edd20a73356da2b6b':
  Part of fix for bug 5523834, backporting cache fixes