RESOLVED MOVED 259305
[SOUP] Does not reuse TCP connection for POST fetch requests
https://bugs.webkit.org/show_bug.cgi?id=259305
Summary [SOUP] Does not reuse TCP connection for POST fetch requests
laurence.ejraee
Reported 2023-07-18 05:54:24 PDT
Created attachment 467066 [details] Image showing TCP connection created again for another POST On any version of wpewebkit, carrying out multiple POST fetch request does not reuse the TCP connection and instead creates a new connection for each request. This occurs on wpewebkit 2.22, 2.28, and epiphany browser running WebKitGTK 2.38.6 For example with: fetch('https://reqres.in/api/articles', { method: "POST", body: JSON.stringify({ title: 'Fetch POST Request Example' }) }); On Chrome two calls to the above code reuse the connection from the first call. On wpewebkit it is not reused. [See image] It is my understanding that persistent connections should be used here because the request and response headers have connection: keep-alive. Persistent connections should keep the TCP connection so that other fetches to the url can reuse the connection. Question: Should multiple POST fetch requests reuse their connection like in Chrome or create a new connection for each request as seen? Thanks.
Attachments
Image showing TCP connection created again for another POST (27.14 KB, image/png)
2023-07-18 05:54 PDT, laurence.ejraee
no flags
Patrick Griffis
Comment 1 2023-07-18 07:35:24 PDT
Can you confirm that this is built with libsoup2 or libsoup3 and what version of libsoup? Also does the website use HTTP/2 or HTTP/1.1 (you can enable the Protocol column in the inspector). This issue is could be one of libsoup and not WPE. Also maybe a real world example that you can find is helpful. Just testing it in the wild here (with libsoup 3 and HTTP/2) and the connection was shared.
laurence.ejraee
Comment 2 2023-07-18 07:44:10 PDT
This is built with libsoup2 version 2.62.3. Looking at the inspector the website is using HTTP/1.1 as request states: POST /stg/v1.0/create-authcode HTTP/1.1 and response states: HTTP/1.1 200 OK I'll see if I can find real world example and update. Thanks.
Patrick Griffis
Comment 3 2023-07-18 07:52:56 PDT
Ah I can confirm that libsoup does not share for POST requests: https://gitlab.gnome.org/GNOME/libsoup/-/blob/d1509188ebd2219db1a147e9d77ffd5b4d161a2e/libsoup/soup-connection-manager.c#L399 I think this issue should be moved there.
laurence.ejraee
Comment 4 2023-07-18 07:56:23 PDT
Thanks for the very quick and valuable feedback, I'll move to libsoup. Kind regards.
Note You need to log in before you can comment on or make changes to this bug.