Just started using google cloud storage. I am having problem receiving gzip files from it. Stored file is gzip'ed but it gets decompressed on request. I have read all documentation, forums and have tried dozens of different combinations of headers and still fetched file in browser is not compressed. Could some one point out what I am doing wrong?
Article about gzip, headers, transcoding https://cloud.google.com/storage/docs/transcoding
I move my file to storage with this command
gsutil -h "Cache-Control:public,max-age=10,no-transform" cp -Z bundle.js gs://lol-champs.tomdid.com
File gets gziped before uploading file and size decreases by 5 times once it gets on storage, I have checked in console.
Browser request headers
Accept:*/*
Accept-Encoding:gzip, deflate, sdch
Accept-Language:en-US,en;q=0.8,lt;q=0.6
Cache-Control:no-cache
Connection:keep-alive
Host:lol-champs.tomdid.com
Pragma:no-cache
Referer:http://lol-champs.tomdid.com/
Response headers
Accept-Ranges:bytes
Access-Control-Allow-Origin:*
Access-Control-Expose-Headers:Content-Encoding
Access-Control-Expose-Headers:Content-Length
Access-Control-Expose-Headers:Content-Type
Cache-Control:public,max-age=10,no-transform
Content-Language:en
Content-Type:application/javascript
Date:Sat, 15 Oct 2016 21:40:14 GMT
ETag:"8505f976c2ffbf1e69c3ee9fdf2f04d5"
Expires:Sat, 15 Oct 2016 21:40:24 GMT
Last-Modified:Sat, 15 Oct 2016 21:40:09 GMT
Server:UploadServer
Transfer-Encoding:chunked
x-goog-generation:1476567609681000
x-goog-hash:crc32c=Gik6aA==
x-goog-hash:md5=hQX5dsL/vx5pw+6f3y8E1Q==
x-goog-metageneration:1
x-goog-storage-class:STANDARD
x-goog-stored-content-encoding:gzip
x-goog-stored-content-length:290207
So google sets custom header that content is gziped in storage but it sends back response to me decompressed and without Content-Encoding header.
Not sure is the way how I upload file is wrong, or it is missing some headers. feeling lost. Link to File -> http://lolchamps.tomdid.com/bundle.js
Any help would be much appreciated.
UPDATE: Found something interesting, if I am requesting file with googles URL- https://storage.googleapis.com/lolchamps.tomdid.com/bundle.js it returns gziped file, if the same file is requested via my domain it returns decompressed version. WHY??? I smell dark magic.