Caching decorator