Uh oh!
There was an error while loading. Please reload this page.
Add header enabling gzip downloads - #3380
Conversation
dhermes
commented
May 6, 2017
@tartavull Can you give a code snippet that doesn't work the way you expect (and explain what you do expect)? |
tartavull
commented
May 6, 2017
Upload a compress file Downloading file I expect that when the http request is made it has the header |
lukesneeringer
commented
May 7, 2017
Sending |
tartavull
commented
May 9, 2017
I haven't seen problems when retrieving uncompressed files, but I haven't test other compression formats. |
lukesneeringer
commented
May 9, 2017
@dhermes Any concerns about this PR? I have no problem adding an |
dhermes
commented
May 9, 2017
I'd like to see what @thobrla or someone else from the Storage team says. I'm just not sure if it makes sense. |
thobrla
commented
May 9, 2017
It's reasonable (even preferable) to include this header, but it is a substantial semantic change. How does the library handle gzipped bytes in the response? Is it up to the caller to decompress them? |
tartavull
commented
May 9, 2017
https://github.com/GoogleCloudPlatform/google-auth-library-python-httplib2 takes care of decompression, no action required by the caller |
dhermes
commented
May 9, 2017
As does |
thobrla
commented
May 9, 2017
Seems fine, then. The caller has always gotten uncompressed bytes and they'll continue to get uncompressed bytes. Out of curiosity, how were mid-download connection breaks handled for content-encoding:gzip objects previously? |
I think you will now get an |
lukesneeringer
commented
May 10, 2017
@tartavull Can you update the unit tests that fail as a result of your change? Once that is done, we can accept this. |
8d02bcc to
bc031ecComparetartavull
commented
May 17, 2017
Do you happen to know how is related to the commit changes? |
@tartavull Sorry for being quiet here for way too long.
|
GET requests now contain the header accept-encoding:gzip This improves performance of compressible strings which were uploaded as gzips. The caller is not required to do any decompression because decompressiong is handle by the library. Confusing `IOError: CRC check failed` exceptions will be risen in the case of mid-download connection breaks.
tartavull
commented
May 17, 2017
@dhermes looking forward to discuss them. |
dhermes
commented
May 17, 2017
@tartavull Do you have some examples? Or did you mean something else? |
dhermes
commented
May 17, 2017
Ah I see. Let me play around a bit with this to try to "break things" / investigate the raw payloads. In the meanwhile, you can check out the underlying library used for uploads (docs and source). You can pass in custom headers to an upload so this perf optimization would be usable immediately for you. |
tartavull
commented
May 31, 2017
Any luck breaking things? |
tartavull
commented
Jun 27, 2017
@dhermes Is there anything I can do to get this merged? |
dhermes
commented
Jun 27, 2017
Sorry @tartavull it fell off my plate of things to do! Really bad of me, eek. I want to test this PR on real use cases before merging. In particular I'd like to test on two files:
and maybe some other cases I haven't thought of? I just want to make sure this "does the right thing". |
tartavull
commented
Jul 11, 2017
@dhermes I understand. Let me know if you need any help from me. |
lukesneeringer
commented
Aug 3, 2017
Poke. |
tartavull
commented
Aug 5, 2017
This PR modifies a single line of code, and it reduces the traffic to google cloud storage for all your users downloading compressed files. For our particular case that's 250x reduction in bytes downloaded. |
lukesneeringer
commented
Aug 7, 2017
@dhermes At this point I want to just merge this. Giving you a chance to throw up a flag, but this should really get in. |
dhermes
commented
Aug 7, 2017
@lukesneeringer If you feel it's the right move, go for it. I worry that it is partially incorrect, e.g. of the thing stored is gzipped then it will accidentally do the wrong thing. |
lukesneeringer
commented
Aug 8, 2017
I am not particularly worried. This is a really common pattern. |
The `_make_transport` method is now spelled `_get_transport`.
googlebot
commented
Oct 13, 2017
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
tartavull
commented
Oct 13, 2017
Thanks :) |

Not really intended to be merged.
I'm just wondering if there is any other way of downloading gzip files that has the correct content-encoding.