Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

firebase-storage: Just get metadata once #357

Closed
Neifen opened this issue Nov 22, 2020 · 1 comment
Closed

firebase-storage: Just get metadata once #357

Neifen opened this issue Nov 22, 2020 · 1 comment

Comments

@Neifen
Copy link

Neifen commented Nov 22, 2020

So I was using the firebase package to download data from the firebase-storage (with flutter on web) and was trying to get two information: first the FullMetadata and second the download-URL.

For both I am using the Firebase-Storage-Reference like this:

var reference = firebaseb.app().storage().refFromURL("gs://blabla").child("myfilename")

I then use the reference above and .getMetadata() for the metadata and .getDownloadURL()for the download-URL. I then really quickly realized how slow my page was when loading my images. I then turned to the chrome-developer tool in the network tab and realized that both calls:

  1. need 500ms to get done (is it because I have a free firebase account?)
  2. they do the same exact call. (The download links is basically the child reference + ?alt=media and the the download token that is in the metadata.

So now my main question is: is it supposed to be like that? Is there a clean way to save half a second per image to get all this information other than creating my own url from the metadata? I saw that there was a getDownloadUrl function in the Metadata object but it's now deprecated.

Thank you for your help

@kevmoo
Copy link
Contributor

kevmoo commented Dec 16, 2020

We're just a wrapper over the JS API. I'd suggest asking in a firebase-focused channel. 🤷 Good luck!

@kevmoo kevmoo closed this as completed Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants