I am trying to upload to google storage using the gcloud library (NodeJS).
I need to enable public-read property and also set the cache-expiration to 5 minutes.
I am using this (simplified) code:
storage = gcloud.storage({options}
bucker = storage.bucket('name');
fs.createReadStream(srcPath).pipe(bucket.file(targetFile).createWriteStream()).on('error', function(err)
How do I go about setting the approprate ACL/cache expire? (I found this but not sure what to make of it: https://googlecloudplatform.github.io/gcloud-node/#/docs/v0.11.0/storage?method=acl)
Thanks for the help
You can set the predefined ACL following the instructions here:
Regarding cache control, I don't believe you can set this as a default, but you can set this at the time of uploading your file:
Reference: https://cloud.google.com/storage/docs/reference-headers#cachecontrol