Added database caching support