Skip to content

Instantly share code, notes, and snippets.

@duhaime
Created December 10, 2017 00:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duhaime/fd4021c2474cc35a14461a6bf3fa0174 to your computer and use it in GitHub Desktop.
Save duhaime/fd4021c2474cc35a14461a6bf3fa0174 to your computer and use it in GitHub Desktop.
Serve gzipped assets from S3
# gzip a text file
gzip -9 data.json
# remove the gzip file extension
mv data.json.gz data.json
# upload to s3
aws s3 cp data.json s3://bucket/data.json --acl public-read --content-type application/json --content-encoding gzip --metadata-directive REPLACE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment