I have some problem with Cloud CDN. I've added a CDN to a bucket connected on an instance.
I need to get an element from CDN, but this element is updated each 1 sec from my server. What happen is that when from browser i get the first time the file I can get the correct one, then the file is never updated again (file is an m3u8 and i get always the same)
The m3u8 file is updated on the bucket but not updated on the cloud CDN. How can i prevent caching on some type of file (or all files) inside my cloud cdn?
UPDATE:
Honestly, by checking my response header directly from bucket, i get "cache-control: public, max-age=3600" I start to thinking the problem is the bucket, how can i set max-age to 0/1 for entire bucket?
P.s. my file are all public and i'm reading this (https://cloud.google.com/storage/docs/gsutil/commands/setmeta):
Note: By default, publicly readable objects are served with a Cache-Control header allowing such objects to be cached for 3600 seconds. For more details about this default behavior see the CACHE-CONTROL section of gsutil help metadata. If you need to ensure that updates become visible immediately, you should set a Cache-Control header of "Cache-Control:private, max-age=0, no-transform" on such objects.
I just want to avoid run a command like this from a cron each sec
gsutil setmeta -h "Content-Type:text/html" \
-h "Cache-Control:public, max-age=0, no-transform" gs://bucket/*.html
There is no general settings to manage an entire bucket directly? (not for each loaded content)
UPDATE: It's an nginx server for live streaming (rtmp).
I got an m3u8 with the indexis of others m3u8 for each quality.
If i mount a bucket on my GCE instance (with gcsfuse), the 1st m3u8 that i get from bucket from my browser will stay cached inside the bucket for 1 hour (max-age=3600)...because of caching.
Files from GCE are not updated with gsutil: are directly written on the mounted bucket with gcsfuse.
To make this files public available, I've setted the bucket to public -> this, for google bucket policy, make them cacheable.
Theorically I need to update all my m3u8 files each 1 sec.
To answer:
Please provide more details about what kind of data and in which way you write to the bucket -> m3u8
What do you want achieve by using Storage bucket -> shared resource for scalable infrastructure
Why do you need to update elements every 5 sec -> need update m3u8 each 1 sec (to update indexes)
That's the problem.