Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Storage very slow compared to Firebase Hosting

Tags:

Anyone know why firebase storage would be so ridiculously slow compared to firebase hosting?

Results

  • Time to download image of firebase hosting: 16ms
  • Time to download same image from firebase storage: 2.23s (2.22s is TTFB)
  • Time to download same image from firebase storage (Asia Pacific Region): 1.72s (1.70s is TTFB)
  • (File size: 22.7kb / jpeg / firebase storage has read open to everyone)

This is repeated over and over in tests. Is there any way to speed this up to a decent time, or is firebase storage unusable for small files (images/thumbs)?

For Comparison

  • S3 North Cal - approximately 500ms
  • S3 Asia Pacific - Approximately 30ms
  • Cloudinary - Approximately 20ms

Extra info:

  • I am based in Australia.
  • Exact same files. Always images under 100kb.
  • The slow down is always in the TTFB according to dev tools.
  • Hosting URL: https://.firebaseapp.com/images/thumb.jpg
  • Storage URL: https://firebasestorage.googleapis.com/v0/b/.appspot.com/o/thumb.jpg?alt=media&token=
like image 988
ro-savage Avatar asked May 08 '17 15:05

ro-savage


People also ask

Why is Firebase Storage so slow?

because firebase checks the authentication rules for a gs link which is good but very slow. If we use the public HTTP links this is much faster, which is how it should be, but then if someone gets that HTTP link to the picture is not private.

Is Firebase Storage fast?

Firebase Storage very slow compared to Firebase Hosting - Stack Overflow. Collectives™ on Stack Overflow – Centralized & trusted content around the technologies you use the most.

Is Firebase Storage same as Google Cloud Storage?

The new Firebase Storage is powered by Google Cloud Storage, giving it massive scalability and allowing stored files to be easily accessed by other projects running on Google Cloud Platform. Firebase now uses the same underlying account system as GCP, which means you can use any GCP product with your Firebase app.

What is the Storage limit on Firebase?

Quota for Hosting storage Storage for your Hosting content is at no cost up to 10 GB. If you are not on the Blaze plan, and you reach the 10 GB limit of no-cost Hosting storage, you won't be able to deploy new content to your sites.


1 Answers

I found the solution.

If you have your files already uploaded to storage go to: https://console.cloud.google.com/storage/browser?project=your_project > pick your bucket > select all interesting files and click Make public (or something similar - I'm not english native).

To have all new uploaded files public by default you need to install Google cloud SDK (https://cloud.google.com/sdk/docs/) and from your command line use the following command for your bucket:

gsutil defacl set public-read gs://your_bucket

After that all my current and new images are available here storage.googleapis.com/my_project.appspot.com/img/image_name.jpg and downloading time is definitely shorter.

like image 71
Żywy Avatar answered Sep 23 '22 07:09

Żywy