🏠 back to Observable

What's your method to compress FileAttachements?

When exporting a notebook that contains a FileAttachment, the files are presented as “blobs” with no indication of their mime-type in the filename.

Some (random(?)) servers do not take a hint that they can transfer them with gzip, and a CSV file that should need 150kB to transfer might need 1.2MB. Slow as hell.

I fixed this locally by adding a .htaccess in the files/ directory with

<IfModule mod_deflate.c>
SetOutputFilter DEFLATE

I’m not sure this is the best way to proceed. Also it might be nice to have something like this “by default”, in order to save bandwidth.