Use cache if in dev mode

Only use cache if in development mode
We don't want to use cache in test or any staging environment.