Add serialization for cache items. gh-1