added secret caching option, disabled by default