write a cache