Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google cloud storage, Cache-Control

I tried to set Cache-Control header for Google Cloud Storage bucket. It gives me 400: Invalid argument error without any explanation what exactly wrong. Any ideas?

Example:

gsutil setmeta -R -h 'Cache-Control:public, max-age=10000, no-transform' gs://example.com/stylesheets/

Setting metadata on gs://example.com/stylesheets/site-77ee6060.css BadRequestException: 400 Invalid argument

Tried with different max-age, with or without no-transform, same result. bucket is configured as website.

like image 978
Ivan Tarapon Avatar asked Jun 23 '14 07:06

Ivan Tarapon


People also ask

How do I clear Google Cloud cache?

In the Google Cloud console, go to the Cloud CDN page. Under Associated load balancers, click the load balancer name. Click the Cache invalidation tab.

What is caching in GCP?

A cacheable response is an HTTP response that Cloud CDN can store and quickly retrieve, thus allowing for faster load times.


1 Answers

I had this issue, and discovered that I did not have OWNER permission on the object anymore (someone else on my team had edited the object).

like image 76
Ross Light Avatar answered Oct 18 '22 20:10

Ross Light