added logic to make caching configurable again