Add conditional to caching setup