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.
Should we be using Bubble-hosted images for our landing pages? The URL is coming from a CDN so theoretically it should be OK but is this a best practice?
Hello!
I recently made a template in Buildship that compresses and converts images in webp (or other if customized), uploads them to Bubble storage of your app, and modifies a ‘thing’s’ field with the images URL from Bubble storage.
Useful If you’re concerned about the size of images uploaded by users.
Yes, it’s all applied when the images are loaded (as opposed to uploaded), so it works with the file uploader too. So the only exception is if the file is stored outside of Bubble’s CDN network.
EDIT: updated the docs to clarify this, thanks again @ZubairLK