From e23e9c48987e8c95a3bedf8b054c74154d72abc6 Mon Sep 17 00:00:00 2001 From: Hoshino Lina Date: Apr 29 2026 02:32:47 +0000 Subject: Use HTTP/1.1 for uploads/downloads This is 20-50 times faster for high latency clients, due to some kind of issue with the HTTP/2 flow control (small record sizes). Signed-off-by: Hoshino Lina --- diff --git a/pyrpkg/lookaside.py b/pyrpkg/lookaside.py index 689b8b6..4eaa3f4 100644 --- a/pyrpkg/lookaside.py +++ b/pyrpkg/lookaside.py @@ -191,6 +191,7 @@ class CGILookasideCache(object): c.setopt(pycurl.LOW_SPEED_LIMIT, 1000) c.setopt(pycurl.LOW_SPEED_TIME, 60) c.setopt(pycurl.FOLLOWLOCATION, 1) + c.setopt(pycurl.HTTP_VERSION, pycurl.CURL_HTTP_VERSION_1_1) # call retry method directly instead of @retry decorator - this approach allows passing # object's internal variables into the retry method @@ -355,6 +356,8 @@ class CGILookasideCache(object): c.setopt(pycurl.NOPROGRESS, True) c.setopt(pycurl.HTTPPOST, post_data) c.setopt(pycurl.FOLLOWLOCATION, 1) + c.setopt(pycurl.UPLOAD_BUFFERSIZE, 1024 * 1024) + c.setopt(pycurl.HTTP_VERSION, pycurl.CURL_HTTP_VERSION_1_1) if self.client_cert is not None: if os.path.exists(self.client_cert):