Correctly handle unhashable types (such as slices) when we try to store in local cache