Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Outline

Manav Rathi1a49770e0bb5
diff --git a/web/packages/gallery/services/download.ts b/web/packages/gallery/services/download.ts
index 62cb27391e..b71ef57854 100644
--- a/web/packages/gallery/services/download.ts
+++ b/web/packages/gallery/services/download.ts
@@ -678,7 +678,10 @@ const photos_downloadThumbnail = async (file: EnteFile) => {
return new Uint8Array(await res.arrayBuffer());
};
-const photos_downloadFile = async (file: EnteFile): Promise<Response> => {
+const photos_downloadFile = async (
+ file: EnteFile,
+ userInitiated: boolean,
+): Promise<Response> => {
const customOrigin = await customAPIOrigin();
// [Note: Passing credentials for self-hosted file fetches]
@@ -715,6 +718,14 @@ const photos_downloadFile = async (file: EnteFile): Promise<Response> => {
// 2. The proxy then does both the original steps: (a). Use the credentials
// to get the pre-signed URL, and (b) fetch that pre-signed URL and
// stream back the response.
+ //
+ // The faster proxy approach is used for interactive requests to reduce the
+ // latency for the user (e.g. when the user is waiting to see a full
+ // resolution file). It can be faster than a direct connection as the proxy
+ // is network-nearer to the user (See: [Note: Faster uploads via workers])
+ //
+ // For background processing (e.g., ML indexing, HLS generation), the direct
+ // S3 connection (as what'd happen when self hosting) gets used.
const getFile = async () => {
if (customOrigin) {
diff --git a/web/packages/gallery/services/upload/index.ts b/web/packages/gallery/services/upload/index.ts
index 4948d2c609..df1e6c6fe7 100644
--- a/web/packages/gallery/services/upload/index.ts
+++ b/web/packages/gallery/services/upload/index.ts
@@ -445,6 +445,8 @@ export type UploadResult =
/**
* Return true to disable the upload of files via Cloudflare Workers.
*
+ * [Note: Faster uploads via workers]
+ *
* These workers were introduced as a way of make file uploads faster:
* https://ente.io/blog/tech/making-uploads-faster/
*
diff --git a/web/packages/gallery/services/upload/remote.ts b/web/packages/gallery/services/upload/remote.ts
index 77a0140d58..abe934ad2d 100644
--- a/web/packages/gallery/services/upload/remote.ts
+++ b/web/packages/gallery/services/upload/remote.ts
@@ -355,8 +355,7 @@ const createMultipartUploadRequestBody = (
* b. Using workers, where the requests are proxied via a worker near to the
* user's network to speed the requests up.
*
- * See the documentation of {@link shouldDisableCFUploadProxy} for more details
- * about the via-worker flow.
+ * See [Note: Faster uploads via workers] for more details on the worker flow.
*
* In both cases, the overall flow is roughly like the following:
*