Any input is appreciated!
tl;dr
yes, probably should ignore .crdownload
files
Syncthing default behaviour
The .stignore
is blank by default, so these files are synced by default.
Question
whether Chrome download files (.crdownload
) should be ignored in Syncthing
Purpose
-
The time taken for such a download to be usable on a remote disk could be maximum
t = 2n
(download time + sync time, assuming the two are equal). -
The minimum, if the partial download is being sent incrementally while it is downloaded, could be just above
t = n
(source: my intution, but it makes sense). -
Recently I have been thinking about this a lot in the shower.
What I know
-
Chrome downloads are stored in
.crdownload
files -
These are replaced with the actual file when complete
-
Ignoring them (whether locally or remotely) does not prevent the local Chrome from resuming the file (it doesnāt delete it). But the remote host will only receive finished files and not
.crdownload
files.
What I think
-
The files are the sequential raw data of the finished file, up to the % last downloaded, and not in some esoteric format. (KISS principle).Ā¹ Ā²
Significance: block reuse applies
-
The files are renamed to the final filename. It would make no sense for Chrome to copy from the
.crdownload
into the finished file then delete it (2x space usage momentarily).Significance: none. Syncthing probably sees the same
delete .crdownload
thencreate actual file
regardless.
Reasons to keep
-
Block reuse. A remote
.crdownload
could have Syncthing reuse its data used to piece together the final file. More on āBlock reuse caveatsā below. -
File could be reused for Firefox or wget to use as resume data if stopped.Ā¹ Ā²
Reasons to ignore
-
File unusable in Chrome if Downloads page record cleared.
-
File unusable in any browser or tool if original URL lost.
-
User confusion. So long as the download is in the Downloads page, it remains on disk. On remote devices, there is no such connection, and the fileās presence is confusing:
-
If the Downloads page is never cleared, the file remains perpetually.
-
If a machine is decommissioned without ever clearing its Downloads page
-
Block reuse caveats
-
Syncthing needs to scan the whole file first to be aware of it (and send it remotely). If the file changes while scanning, this process is aborted, until the scan can complete the next time. This tug of war may depend on the following:
-
If the download
is paused
/speed is 0
/speed is slow
, and/or thedisk read speed is high
, Syncthing has a higher chance of winning (completing scan first). -
And the inverse is true as well
-
-
Once a file is completed, Syncthing will see
delete .crdownload
andcreate actual file
.Ā³ Depending on the order of these operations, either:-
the block is reused. The download is available sooner on the remote device rather than
t = 2n
. -
the
.crdownload
is delete remotely and is not able to be reused.
-
-
.crdownload
files could be reused remotely after remote deletion if:-
a currently-for-block-reuse file is blocked from remote deletion until its blocks are completely reused. Seems unlikely. No idea without knowing Syncthing internals.
-
Files are moved to .stversions folder AND this folder is added as another folder in Syncthing ā“ āµ
-
Conclusion
The benefits are real but seemingly marginal and the caveats are numerous.
For a partial download to be reusable remotely and compatible with Syncthing, it should maintain the original filename throughout, such as when created using wget or curl. Otherwise, itās probably a good idea to exclude .crdownload
files.
Sources
- browser - How can I resume a download started in Chromium? - Ask Ubuntu
- windows 7 - Resume interrupted downloads in Chrome - Super User
- Reuse of files between different folders - Support - Syncthing Community Forum
- Does Syncthing reuse blocks from ignored files? - Development - Syncthing Community Forum
- Re-use as many existing file pieces as possible Ā· Issue #1909 Ā· syncthing/syncthing