Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does my Firefox browser take over a hundred times longer to upload large files compared to Google Chrome?

I have a server-side program on localhost, and I use a form to upload a 300MB file. However, I've noticed a discrepancy between Google Chrome and Firefox – Google Chrome returns a successful result within a few seconds, while Firefox takes around 3 minutes. The code and network environment are consistent. What could be causing this discrepancy?

Here is my code:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Upload</title>
  </head>
  <body>
    <h2>Upload</h2>
    <form action="http://127.0.0.1:9527/api/upgrade/upload" method="post" enctype="multipart/form-data">
      <label for="fileInput">chooseFile:</label>
      <input type="file" id="fileInput" name="files">
      <button type="submit">Upload File</button>
    </form>
  </body>
</html>

I have tried changing the server-side programming languages (Java, Go) and upgrading versions, but they are already the latest.

like image 308
Fare丶梦 Avatar asked Oct 19 '25 13:10

Fare丶梦


1 Answers

There is a known Firefox bug that been worked on for years to try and improve and mitigate against. Unfortunately, for some users in certain scenarios with certain network bandwidths, large uploads will be slower than using other browsers, for example Chrome.

There is a mammoth bug trail that you can read on your next train ride somewhere!

The main cause they believe is due to poor HTTP/2 upload performance and can be traced back to their forcing of the TCP send buffer size to 128KB once 128 KB has been uploaded.

There has been some good fixes in the past 6 months according to that bug trail so hopefully this will no longer be an issue soon. Keep your version up to date.

like image 64
jQueeny Avatar answered Oct 22 '25 01:10

jQueeny