From: Joel Rosdahl Date: Thu, 27 Jan 2022 19:10:05 +0000 (+0100) Subject: feat: Enable HTTP keep-alive by default (#1000) X-Git-Tag: v4.6~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15fecbd7d540393e4dade71be78d7c10c69535cc;p=thirdparty%2Fccache.git feat: Enable HTTP keep-alive by default (#1000) --- diff --git a/doc/MANUAL.adoc b/doc/MANUAL.adoc index 558f107a7..ae386fb14 100644 --- a/doc/MANUAL.adoc +++ b/doc/MANUAL.adoc @@ -1105,13 +1105,7 @@ Optional attributes: * *connect-timeout*: Timeout (in ms) for network connection. The default is 100. * *keep-alive*: If *true*, keep the HTTP connection to the storage server open - to avoid reconnects. The default is *false*. -+ -NOTE: Connection keep-alive is disabled by default because with the current -HTTP implementation uploads to the remote end might fail in case the server -closes the connection due to a keep-alive timeout. If the general case with -short compilation times should be accelerated or the server is configured with -a long-enough timeout, then connection keep-alive could be enabled. + to avoid reconnects. The default is *true*. * *layout*: How to map key names to the path part of the URL. Available values: + -- diff --git a/src/storage/secondary/HttpStorage.cpp b/src/storage/secondary/HttpStorage.cpp index d768d1983..b7b79e8df 100644 --- a/src/storage/secondary/HttpStorage.cpp +++ b/src/storage/secondary/HttpStorage.cpp @@ -110,7 +110,7 @@ HttpStorageBackend::HttpStorageBackend(const Params& params) m_http_client.set_default_headers({ {"User-Agent", FMT("{}/{}", CCACHE_NAME, CCACHE_VERSION)}, }); - m_http_client.set_keep_alive(false); + m_http_client.set_keep_alive(true); auto connect_timeout = k_default_connect_timeout; auto operation_timeout = k_default_operation_timeout;