Revert r201751 and solve the const problem a different way - by
making the cache mutable.