Caching of arbitrary objects