Forum Academy Marketplace Showcase Pricing Features

Best practice for storing/retrieving images in Bubble

I’m looking for help understanding the best way to use a large amount of images to optimize for site performance and cost. I’m currently using three different methods, but not sure which is more performant or cost effective.

First Method
Store images in the database and do a dynamic search to pull it up.

Second Method
Store images in the database, but get the image URL and paste it into the dynamic field. I believe Bubble treats this the same as a static image. I then use the fixed ratio option to make sure the image stays the right size when the page width changes

Third Method
I use this when an image is already hosted somewhere else and I have permission to use. I don’t store anything in the database. Instead I just grab the image URL and post it in the dynamic field like the second method above. I’ve noticed these images are slow to load, but it might be because of the size. Some are 2-5 MB, but I’m not storing it so I save on data.

Any thoughts on what the best option would be?

Seems like 3 different options for 3 different use cases, so no best option to choose from since they are seemingly used for different reasons. For example, in number 3, do you have an option to save the image to your DB or just to copy the URL?

Personally, in my apps, I don’t do any of these.

I use a plugin to compress the images to a smaller file size to save on storage as well as for faster rendering of the images when I want to display the image.

Your option 2 is no different really from option 1 except that it takes more time to develop, is not dynamic in any way and will be a nightmare to maintain most likely.