``` 让 Firefox 中的大文件下载支持断点续传 ```
Making big downloads resumable in Firefox

原始链接: https://lunarwatcher.codeberg.page/til/firefox/resumable-big-downloads.html

``` **摘要** 自 Firefox 28(2014年)以来,浏览器默认自带 `network.http.response.timeout` 设置为 300 秒。这似乎会干扰大文件下载的恢复,并影响其整体稳定性。在高级首选项中将该值改为 0(或一个非常大的数字)可以使大文件下载可恢复且稳定性有所提高,尽管作者并不完全了解其机制。 此修复仅在服务器支持恢复下载时才有帮助——真正的问题是 Firefox 无法恢复本应可恢复的下载。根据实验,恢复下载似乎依赖于连接超时,而非 `.part` 文件;如果没有此更改,Firefox 会忽略这些文件。 恢复下载的不稳定性至少自 2005 年以来就是一个已知问题。存在手动处理 `.part` 文件的变通方法,但作者避免使用它。作为一种替代方案,`wget -c -O` 可以在 Firefox 之外提供稳定的恢复下载。作者还怀疑 Firefox 在下载失败之前会进行隐藏重试,而超过此超时时间会干扰该过程。这些发现基于实验,而非 Firefox 的源代码。 ```

一场 Hacker News 讨论回应了一篇关于让 Firefox 大文件下载可断点续传的帖子。评论者持怀疑态度,称所提议的超时调整只是安慰剂,并指出 Firefox 没有隐藏的重试机制。对于一次性 URL,一个常见变通方法是保留 `.part` 文件,重启/暂停,再把它换回去以续传。一些人警告,如果服务器提供的是不同文件或版本,且没有 ETag/Last-Modified/哈希匹配,这会有损坏风险。许多人感叹浏览器仍处理不好大文件下载,而专用工具——GetRight/Go!Zilla、aria2、axel、`wget -c`、IDM、JDownloader——早已支持续传、并行连接和重试。有人说 Firefox 续传通常对他们有效,尤其是普通 URL;失败往往涉及过期链接、不稳定连接或付费主机。其他人分享 curl/VPS 工作流,并请求更好的浏览器集成。该帖混合了实用变通方法、对 Mozilla 的批评,以及对经典下载管理器的怀旧。
相关文章

原文
Making big downloads resumable in firefox

For whatever reason, Firefox 28 and newer (i.e. every modern version after like 2014) ships with network.http.response.timeout set to 300 seconds. This seems to interfere with resuming big downloads, as well as the general stability of big downloads.

Setting network.http.response.timeout to 0 (or something very big) in about:config seems to make big downloads both resumable and at least a little more stable. I don't understand why this works, but experimental testing supports it.

Note that this assumes the server supports resumable downloads; if it doesn't, no settings in firefox or any other browser are going to help. However, the problem this fixes is firefox being unable to resume a resumable download on error. I don't entirely know if this is the case, but it experimentally looks like resumable downloads in firefox rely on connection timeouts rather than the .part files they download. Firefox will happily ignore an existing .part without this option, and I do not understand why.

Resumable downloads in firefox generally appear to be fairly unstable though. This has been a known problem in some form since as far back as 2005. I also found that there's a manual .part shuffle to make firefox actually resume downloads, but I'm not doing that shit. As a non-firefox workaround, using wget -c -O "$filename" "$url" also works, and wget overall appears to be fairly stable.

I do also suspect firefox does some hidden retries if it can before it considers the download to have failed - from some experimental testing, it does appear that this is at least partly related to network.http.response.timeout, and that exceeding the timeout interferes with this process.

I have not attempted to confirm any of this with FF's source code, because I have no clue where to look.

This site is anti-gen-AI. All content is 100% organic and written by a foxwolfgirl.


Page rendered with Violet, my own static site generator.

联系我们 contact @ memedata.com