Allow setting the "Cache-Control" header on PUT

Bug #1321254 reported by Alexander Surma
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
goamz
New
Undecided
Unassigned

Bug Description

Both Amazon's S3 as well as Google's GCS use the `Cache-Control` header on upload to define the caching behavior. As it might be critical to not serve stale data, it would be nice to have a way to control this header on up[load.

Thinking one step further ahead, I have the following proposal: The most generic solution to this problem in my opinion is to expose the `net/http.Client` used by the `S3` and/or `Bucket` type and not rely on `net/http.DefaultClient`. This way, a patched `net/http.RoundTripper` can take care of setting the appropriate headers.

Before I submit a patch I'd like to confirm with you that this is the way to go.

Related branches

Revision history for this message
Bjorn Roche (bjorn-1) wrote :

I would love a solution for this. Amazon has lots of headers you can set, but, of course, cache-control is the most important.

I think the best solution would be to overload Bucket.Put with an additional argument that contains additional headers.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.