Description
I've searched in the documentation but I haven't found a way to set the Content-Encoding header when uploading files to Storage.
In our use case, we are storing in Supabase Storage big files that would compress nicely with gzip (compressed files are just ~10% of uncompressed size).
We upload these files from an Edge function and consume them in the browser.
If we could set the Content-Encoding we could save bandwidth and storage space by storing them compressed and then letting the browser ungzip the file when fetching it.
Suggested solution
const file = await Deno.open(localPath, { read: true });
const compressedStream = file.readable.pipeThrough(new CompressionStream('gzip'));
await supabase.storage
.from('my_bucket')
.upload(remotePath, compressedStream, {
contentType: 'application/octet-stream',
contentEncoding: 'gzip'
});
Alternative
No response
Additional context
No response
Validations
Description
I've searched in the documentation but I haven't found a way to set the Content-Encoding header when uploading files to Storage.
In our use case, we are storing in Supabase Storage big files that would compress nicely with gzip (compressed files are just ~10% of uncompressed size).
We upload these files from an Edge function and consume them in the browser.
If we could set the Content-Encoding we could save bandwidth and storage space by storing them compressed and then letting the browser ungzip the file when fetching it.
Suggested solution
Alternative
No response
Additional context
No response
Validations