Anjanesh

Assignment Statements, Comparisons & Observations
Font: Size: + -

Uploading gzipped content to Google Storage via gsutil

Thursday, January 17, 2013

Blogging this, since it doesn't fit on twitter.

It took me sometime to figure out the proper usage of gsutil when uploading files to google storage with the -z option to stream gzipped content. Just make sure to send in the content-type header too.

gsutil -h "Vary:Accept-Encoding" -h "Cache-Control:public,max-age=31536000" -h "Content-Type: text/javascript" cp -z js -a public-read script.min.js gs://[bucket]/script.js

0 comments: