0

Google Cloud Storage NodeJS Library v0.33 https://googlecloudplatform.github.io/gcloud-node/#/docs/v0.33.0/storage/file?method=createWriteStream

Can anyone clarify what does the gzip option for createWriteStream exactly do? The documentation is a bit unclear to me. The description states:

Automatically gzip the file. This will set options.metadata.contentEncoding to gzip.

It appears that it can do one of two things:

  1. Actually gzip the file (requiring user to unzip file manually)
  2. Automatically gzip the http response, but the file upon transfer completion is not gzipped. (i.e. HTTP compression)

Since contentEncoding is set, I presume that the case is actually #1. If transferEncoding was set instead, then I would guess #2. (Ref: Transfer-Encoding: gzip vs. Content-Encoding: gzip). However, I'm concerned that the contentEncoding is actually used as a transport layer detail.

Community
  • 1
  • 1
t0nyh0
  • 650
  • 3
  • 8

1 Answers1

0

gcloud-node will gzip the file (https://github.com/GoogleCloudPlatform/gcloud-node/blob/v0.34.0/lib/storage/file.js#L846) and store the contentEncoding as gzip per the instructions:

An object can generally be served in gzip format if you store it with gzip compression and set its contentEncoding property to gzip.

Community
  • 1
  • 1
Stephen
  • 5,560
  • 1
  • 21
  • 31