CacheConfig cacheConfig = CacheConfig.custom() .setSharedCache(false) .setAsynchronousWorkersMax(0) .setMaxCacheEntries(10000) .setMaxObjectSize(1024*1024*10) .build(); httpClient = CachingHttpClients.custom() .setCacheDir(httpCachePath.toFile()) .setCacheConfig(cacheConfig) .build();