Hoisted hash caching logic up to HashCachingObject.