add optional caching support