1
votes

I want to put a CDN in front of a Google Cloud Run service in order to cache some responses.

Right now it seems Cloud CDN requires a Google Load Balancer, and they cannot point to a Google Cloud Run service (https://github.com/ahmetb/cloud-run-faq/tree/e7a0fc43d3054456613c09e073db289ddf76dd33#how-can-i-configure-cdn-for-cloud-run-services).

Is there another way?

2
I thought I could do it via a Internet Network Endpoint Group pointing to the [...].run.app domain, but it's a dead-end.HectorJ
This is coming in the medium term - both HTTPS Balancing & Cloud CDN will be able to front Cloud Run. See twitter.com/ahmetb/status/1227653149835448320 for an example! If you have an account team, please reach out to them.elithrar

2 Answers

3
votes

[updated]

You can use Cloud CDN with Cloud Run via Google Cloud Load Balancer

0
votes

Additionally it's possible without using the Load Balancer by serving it through a Firebase app by adding a Cache-Control header and via a rewrite rule in firebase.json (via the unofficial Cloud Run FAQ).