// set timeouts for the HTTP client
int globalTimeout = readFromProperty("bdTimeout", 10000);
int connectTimeout = readFromProperty("bdConnectTimeout", globalTimeout);
int connectionRequestTimeout = readFromProperty("bdConnectionRequestTimeout", globalTimeout);
int socketTimeout = readFromProperty("bdSocketTimeout", globalTimeout);
RequestConfig requestConfig = RequestConfig.copy(RequestConfig.DEFAULT).setConnectTimeout(connectTimeout)
.setSocketTimeout(socketTimeout).setConnectionRequestTimeout(connectionRequestTimeout).build();
// configure caching
CacheConfig cacheConfig = CacheConfig.copy(CacheConfig.DEFAULT).setSharedCache(false).setMaxCacheEntries(1000)
.setMaxObjectSize(2 * 1024 * 1024).build();