Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

integrate Firebase storage with Google cloud CDN

i'm making an app using firebase.

photos uploaded by users are saved in firebase storage.

I use firebase cloud functions to make thumbnails to load photo feed faster,

but in one page, I need to load original photos(max 30 pics) at once.

To load original photos faster, I want to use google cloud CDN.

I followed docs here google cloud cdn docs , made load balancer and cdn

enter image description here

I can see Cloud CDN : Enabled (that Backend buckets are my firebase storage), but it seems to be not working.

in my app, I load those pictures with firebase storage urls which look like 'firebasestorage.googleapis.com/....'.

How can I integrate my firebase storage with google cloud cdn??

like image 854
HB.K Avatar asked Apr 24 '18 09:04

HB.K


1 Answers

Using firebasestorage.googleapis.com sounds like the problem here. When you set up Cloud CDN in your project, you had to create an HTTP(S) Load-Balancer in order to expose a bucket. Cloud CDN will only kick in if you're accessing your data via that Load-Balancer. Try accessing the Load-Balancer's public IP instead of the firebase URL. You can find the IP address right there in the same page you've screenshot. Finally, don't forget to make sure the files you want to make available via the CDN obey these restrictions.

like image 52
Lopson Avatar answered Sep 30 '22 04:09

Lopson