Google Cloud CDN page rules or mappings

305 Views Asked by At

I'd like to use Google Cloud CDN with my website that's already hosted on Google Cloud.

The website is behind HTTP(s) Load Balancer that's set up via GKE ingress.

Now, the problem is that my LB is using several backends. Some of them are backend APIs, but one of them is a server that serves the HTML files. I can't find anything like Cloudflare's page rules in Google Cloud CDN that will allow me to set up rules for which paths to cache, and which to not.

Is it at all possible? Can't find any info on this for either direct Cloud CDN configs or the Ingress-based ones.

1

There are 1 best solutions below

0
On

You have a couple of directives that

can be overridden on a per-route basis

docs

If you need more flexibility with the response headers to make your implementation, take a look at the custom response headers.

EDIT: I would specify by default all paths to be cached and those that you don't want cached, specify it via the no-store flag.