You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HTTP range requests are used by pacman if the file is already partially available on the local file system, so that pacman does not download the entire file.
Notice that there is one special case which complicates matters:
Assume that the client sends a request to download a file starting at byte b. Assume that flexo is not able to fulfill this request from the local cache because we have only s bytes of this file available locally, where s < b. So in that case, we need to fetch the file from a remote mirror. What range are we going to request from the remote mirror?
Requesting the range s- (i.e., everything starting from byte s) would allow us to concatenate the payload to the existing file. This would not work as intended if b is much larger than s: Imagine the client has already 1GiB of the file available locally, but flexo does not have this file available locally yet. In this case, flexo would first have to download 1GiB from the remote mirror until it could start sending data to the client. With a slow internet connection, the client could time out before he receives the first byte.
Requesting the range b- would allow us to start sending data to the client immediately, so we would not run into timeouts or anything similar. But the remaining question is: how should we store the payload we receive from the server? Flexo is currently based on the assumption that all locally stored files start at byte 0, and not some arbitrary byte b. Storing incomplete files that lack data at their beginning (not their end) would make things much more difficult.
Since we assume that the case described above is a rare special case, we choose the following workaround:
Instead of sending a request to the remote mirror, we just respond with a redirect so that the client fetches the file directly from the remote mirror.
The text was updated successfully, but these errors were encountered:
HTTP range requests are used by pacman if the file is already partially available on the local file system, so that pacman does not download the entire file.
Notice that there is one special case which complicates matters:
Assume that the client sends a request to download a file starting at byte
b
. Assume that flexo is not able to fulfill this request from the local cache because we have onlys
bytes of this file available locally, wheres < b
. So in that case, we need to fetch the file from a remote mirror. What range are we going to request from the remote mirror?s-
(i.e., everything starting from bytes
) would allow us to concatenate the payload to the existing file. This would not work as intended ifb
is much larger thans
: Imagine the client has already 1GiB of the file available locally, but flexo does not have this file available locally yet. In this case, flexo would first have to download 1GiB from the remote mirror until it could start sending data to the client. With a slow internet connection, the client could time out before he receives the first byte.b-
would allow us to start sending data to the client immediately, so we would not run into timeouts or anything similar. But the remaining question is: how should we store the payload we receive from the server? Flexo is currently based on the assumption that all locally stored files start at byte 0, and not some arbitrary byteb
. Storing incomplete files that lack data at their beginning (not their end) would make things much more difficult.Since we assume that the case described above is a rare special case, we choose the following workaround:
Instead of sending a request to the remote mirror, we just respond with a redirect so that the client fetches the file directly from the remote mirror.
The text was updated successfully, but these errors were encountered: