Optimize firebase cloud Storage

Asked

Viewed 53 times

0

I’m developing an application using the Firebase Realtime Database and the Firebase Cloud Storage. According to the documentation, to access an image I need to invoke the method getDownloadURL in the path reference where it was saved.

Imagine that I have a list drawn in a loop, and for each record I have 2 to 3 images, it is very expensive for the application to invoke this method for each image I need to display on the screen. Some way to improve this logic?

1 answer

1


I suggest you do the getDownloadURL() when you upload the image to Storage. Then you take this url and store it in your database.

When you read the data, you will also read the downloadURL. No longer need to invoke the method.

  • The first thing I thought was this, but it is safe to do this knowing that there is a token in queryString of the url that may expire some day?

  • Token expires only if revoked directly on Firebase console.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.