Added support for credentials caching