googleapis/google-api-ruby-client

Update cache_control with insert_object of storage

swati-murarka opened this issue · 1 comments

I am using insert_object method of StorageV1 ruby gem and want to set the Cache-Control to 'no-cache, max-age=0'.

I am able to push the test.txt object to storage bucket using below method but unable to set the Cache value to 0:

storage_client.insert_object(bucket.name, name:'test.txt', content_type:'text/plain', upload_source: test,txt, options:{"cacheControl":"no-cache, max-age=0"})

Can somebody help me with how to set the Cache-Control valueto 'no-cache, max-age=0' with insert_object ruby method?

Hi Swati,
Have you tried no-store / no-cache?
https://cloud.google.com/storage/docs/metadata#cache-control
https://cloud.google.com/storage/docs/caching

If you don't want to cache it at all: no-store
or if you want to cache it later: no-cache

These should help. Closing this ticket now.