Specify encoding and deserialize for caching