protected void setStrategiesForClient(HttpClientBuilder httpClientBuilder, UrsusHttpClientConfiguration configuration) {
final long keepAlive = configuration.getKeepAlive();
// don't keep alive the HTTP connection and thus don't reuse the TCP socket
if (keepAlive == 0) {
httpClientBuilder.setConnectionReuseStrategy(new NoConnectionReuseStrategy());
} else {
httpClientBuilder.setConnectionReuseStrategy(new DefaultConnectionReuseStrategy());
// either keep alive based on response header Keep-Alive,
// or if the server can keep a persistent connection (-1), then override based on client's configuration
httpClientBuilder.setKeepAliveStrategy(new DefaultConnectionKeepAliveStrategy() {