Improving serialization/deserialization of responses to/from the cache