I am hosting a Firebase App and connected my custom domain to it, which was working smoothly. So my app is accessible at: https://example.com
Now, I want to serve the images, which are upload to the default Google Storage Bucket at a clean url (without access token) at: https://example.com/img/myimage.jpg. Futhermore, the images should be delivered via the CDN. How can this be achived?
What I have figured out so far:
- I can make the bucket public and am able to access the image by this URL-pattern: https://storage.googleapis.com/mybucketname/myimage.jpg => The downside: No CDN and no custom domainname.
- I probably could setup another CDN in GCP, configure custom domain and point it to the bucket as described here: https://cloud.google.com/load-balancing/docs/https/adding-a-backend-bucket-to-content-based-load-balancing The downside: I would prefer to use the exising CDN that Firebase is providing. Furthermore, the CDN from GCP seems to require an additional load-balancer, which is a bit of an overhead in terms of pricing.
I hope there is a simpler solution for solvig this common use case. Thx for support.