WL-2304 Don’t allow modification from the cache.

We were returning the object directly from the cache which meant that callers could modify the object and then this would be returned to future callers.