Gzip files before upload to s3 #391

Closed
opened 2021-06-30 09:22:23 +02:00 by Irev-Dev · 1 comment
Irev-Dev commented 2021-06-30 09:22:23 +02:00 (Migrated from github.com)

The stls from CadQuery and OpenSCAD are text based stls and so we're throwing away bandwidth and taking a performance hit by not gziping.

Gzip for s3 basically needs to be gziped before upload and than have

'content-type'      :  'text/stl'
'content-encoding'  :  'gzip'

set.

https://stackoverflow.com/questions/8080824/how-to-serve-gzipped-assets-from-amazon-s3

The obvious part that needs to change is putObject in app/api/src/docker/common/utils.js but there might be a few more nuances.

The stls from CadQuery and OpenSCAD are text based stls and so we're throwing away bandwidth and taking a performance hit by not gziping. Gzip for s3 basically needs to be gziped before upload and than have ``` 'content-type' : 'text/stl' 'content-encoding' : 'gzip' ``` set. https://stackoverflow.com/questions/8080824/how-to-serve-gzipped-assets-from-amazon-s3 The obvious part that needs to change is `putObject` in `app/api/src/docker/common/utils.js` but there might be a few more nuances.
t-paul commented 2021-06-30 15:04:16 +02:00 (Migrated from github.com)

Note that the latest OpenSCAD release supports binary STL too, it just keeps the default for command line calls to be ASCII as some external tooling depends on that. GUI export now defaults to binary.

echo 'cube();' | openscad --export-format=binstl -o cube.stl -
Note that the latest OpenSCAD release supports binary STL too, it just keeps the default for command line calls to be ASCII as some external tooling depends on that. GUI export now defaults to binary. ``` echo 'cube();' | openscad --export-format=binstl -o cube.stl - ```
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: h3n3/cadhub#391