I have a bucket in Google Cloud Storage, which I want to configure in two ways –
-
Make it a CDN hosted file – I want to be able to download the file directly. I am able to do this, but not run a cloud function
-
Run a cloud function every time this file is downloaded – when I set this up, I loose access to the static URL that gets replaced by the cloud function URL. Now this runs the cloud function every time, but obviously, since the URL is not static, I am loosing on caching benefits by the browser.
I want to achieve both in Google cloud. Looks like only one of them is possible at a time.
Goal – run a cloud function once every new GET request is made to the file.
Do I have to use a different CDN function that treats Google Cloud as an origin? Can both be achieved in Google Cloud itself?