8/2/2023 0 Comments Cdn image resize![]() ![]() Edit or resize any image by clicking the image preview. If you're are building something where images are more static in use like an e-commerce or blog site, using the function to generate + store resized images totally make sense though.ĮDIT: And it's not very complicated to transform an image and store it in B2 vs just returning it to the client. Free image hosting and sharing service, upload pictures, photo host. Once I figure out all the various sizes and such that I'll need I may save out those predefined images but it's 100% up to just meeting whatever needs I come across.įor example, I may end up auto generating a few sizes (thumbnail, preview, etc) that I KNOW I need for various pages/screens, but still keep the API to get custom image sizes as needed (I'm building an image-based platform). Share Improve this answer Follow answered at 20:09 Lilith River 16. ![]() No changes are required to put a CDN in front of server. Mostly because I'm still in the early stages of my product and as I work through UI/UX problems my image needs may change and I value the flexibility the API approach offers right now. It knows about ImageResizer, and proxies traffic to it, but ImageResizer doesnt need to know anything about the CDN. ![]() You certainly can do that, I don't at the moment however. I imagine you could do the same thing with AWS lambda but I know Firebase gives you a decent free tier so could be good to explore the idea there, get a sense of usage, and then pick the serverless platform that makes the most financial senseĮDIT: Firebase Pricing Page for your reference - ĮDIT 2: As an example, here's a photo from the API vs the static file stored in B2 Serve high-quality images in the right size to reduce page weight and load time. I have Cloudflare in front of the endpoint so the resized image responses can be cached fairly heavily reducing actual HITs to my cloud function. Resize your images for free, either JPEG or PNG images. I store source images in a B2 bucket and have a Cloud Function endpoint that takes a image path and resize options and uses a package called Sharp.js to resize/adjust the image quality on the fly, then return the output to the client. Depending on what your traffic is like, Firebase Cloud functions + Cloudflare could work for you (I'm currently using this setup but I'm still at MVP so can't give feedback for things at scale). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |