Optimize firebase cloud storage

0

I'm developing an application using the Firebase Realtime Database and Firebase Cloud Storage . According to the documentation , to access an image I need invoke the getDownloadURL method 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 costly for the application to invoke this method for each image I need to display on the screen. Any way to improve this logic?

    
asked by anonymous 07.05.2018 / 13:29

1 answer

1

I suggest you do getDownloadURL() when uploading the image to Storage. Then you get this url and save it in your database.

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

    
08.05.2018 / 00:23