]> git.ardis.lu - sheets-db/commitdiff
Update query MIME type to text/plain
authorArdis Lu <ardisglu@gmail.com>
Sun, 29 Aug 2021 07:51:38 +0000 (00:51 -0700)
committerArdis Lu <ardisglu@gmail.com>
Sun, 29 Aug 2021 07:51:38 +0000 (00:51 -0700)
This MIME type signals to the CDN to compress the file. The default MIME type 'application/octet-stream' will not be compressed by default.

Code.gs

diff --git a/Code.gs b/Code.gs
index e6755bc44f4c187dbbffc7d324826bb8b870828d..e64041233ade8bf272ad835b06b84c156727f37b 100644 (file)
--- a/Code.gs
+++ b/Code.gs
@@ -139,7 +139,7 @@ function uploadToBackblaze() {
   // b2_upload_file
   const file = DriveApp.getFileById(FILE_ID);
   const fileName = file.getName();
-  const mimeType = file.getMimeType();
+  const mimeType = 'text/plain'; // Use 'text/plain' to enable compression by CDN. file.getMimeType() gives 'application/octet-stream', which will not be compressed.
   const contentLength = file.getSize();
   const data = file.getBlob();
   const digest = Utilities.computeDigest(Utilities.DigestAlgorithm.SHA_1, data.getBytes());
This page took 0.037505 seconds and 4 git commands to generate.