I get a lot of questions about how images are processed in Bubble. In this post, and a new article, I’ll try to clear up some misunderstandings:
When you upload an image to Bubble, the original file remains unchanged. However, Bubble automatically generates optimized copies of the image for performance purposes. These optimized versions are created at run-time and cached for efficiency.
Image Caching and Transformation:
- Bubble dynamically resizes images based on the container size and device resolution, ensuring optimal display.
- Transformed images are cached for up to 30 days, even if the original image is deleted.
- The transformed copies don’t count toward your storage limit.
Do You Need to Compress Images Before Uploading?
Generally, it’s not necessary to resize or compress images before uploading. Bubble automatically handles this. However, if you’re looking to conserve storage, resizing images beforehand can be helpful, especially for larger screens.
Handling User-Uploaded Images:
If you’re concerned about the size of images uploaded by users, you can set a maximum file size or use a plugin to compress images before they’re uploaded. For best results, ensure images are stored in Bubble’s file storage, which allows them to benefit from the automatic optimization process.
For more details, check out the full guide in the manual: Images | Bubble Docs
Books:
Ultimate Guide to Bubble Performance | Ultimate Guide to Bubble Security
Socials:
X: @petteramlie | LinkedIn