serialize data going into the cache