diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index 9614c0d1f91..f5ee5c24c8a 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -749,7 +749,8 @@ HTTPClient::HTTPClient() { ssl = false; blocking = false; handshaking = false; - read_chunk_size = 4096; + // 64 KiB by default (favors fast download speeds at the cost of memory usage). + read_chunk_size = 65536; } HTTPClient::~HTTPClient() { diff --git a/doc/classes/HTTPClient.xml b/doc/classes/HTTPClient.xml index cf40d57b242..623a5ce2476 100644 --- a/doc/classes/HTTPClient.xml +++ b/doc/classes/HTTPClient.xml @@ -181,7 +181,7 @@ The connection to use for this client. - + The size of the buffer used and maximum bytes to read per iteration. See [method read_response_body_chunk]. diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml index e566e6d17b3..1d2c6fafcb9 100644 --- a/doc/classes/HTTPRequest.xml +++ b/doc/classes/HTTPRequest.xml @@ -125,9 +125,9 @@ Maximum allowed size for response bodies. - + The size of the buffer used and maximum bytes to read per iteration. See [member HTTPClient.read_chunk_size]. - Set this to a higher value (e.g. 65536 for 64 KiB) when downloading large files to achieve better speeds at the cost of memory. + Set this to a lower value (e.g. 4096 for 4 KiB) when downloading small files to decrease memory usage at the cost of download speeds. The file to download into. Will output any received file into it.