8

So here is the scenario:
When I access files from Firebase Storage:

  1. I get my file from storage bucket(.html, .png, .zip etc) (Small in size btw no more than 2mb).
  2. Store that file in my local storage so the app don't need to download it again and consume the bandwidth of the server.
  3. Use it from local storage everytime the app needs it.

When I access files from Firebase Hosting:

  1. I get my file from nearest CDN of Firebase(.html, .png, .zip etc) (Small in size btw no more than 2mb).

  2. Store that file in my local storage so the app don't need to download it again and consume the bandwidth of the server.

  3. Use it from local storage everytime the app needs it.

NOTE: I also have one file version.txt on storage bucket (Firebase Storage). According to the value in this file, I decide whether to fetch file in Step 1 again or not. It means the version.txt is fetched everytime.

Questions:

  1. How to achieve the similar version programming part in Firebase Hosting? I know we deploy folders, can we get their version from Firebase CDN. If yes, how?
  2. In which method I gonna first hit my LIMIT as we know Firebase is paid after a limit.

Pros of Hosting: It will be faster. Link

PS:
1. My concern is bandwidth and not security.

  1. Currently, I am using basic Plan (free) with limits Source:

Hosting Plan Details Storage Plan Details

Ishaan Kumar
  • 968
  • 1
  • 11
  • 24

1 Answers1

7

From the Firebase docs:

  • The Firebase Realtime Database stores JSON application data, like game state or chat messages, and synchronizes changes instantly across all connected devices.
  • Firebase Remote Config stores developer-specified key-value pairs to change the behavior and appearance of your app without requiring users to download an update.
  • Firebase Hosting hosts the HTML, CSS, and JavaScript for your website as well as other developer-provided assets like graphics, fonts, and icons.
  • Cloud Storage stores files such as images, videos, and audio as well as other user-generated content.

Storage has higher free tier limits, while Hosting might be a little faster. Note that all files on Hosting are publicly accessible, so if you need authentication or authorization, you should use Storage.

Mike McDonald
  • 15,609
  • 2
  • 46
  • 49