farmsvast.blogg.se

Cdn image resize
Cdn image resize





cdn image resize

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.

cdn image resize

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). Image Resize & Crop: This option can take a Yes or No value. 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. You certainly can do that, I don't at the moment however.

#Cdn image resize free

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 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. This capability is often achieved by including the complete URL of the existing image within the URL for the image generated by the image CDN. 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. Image CDNs can usually be configured to automatically retrieve images from their existing locations when they're needed. If you would like to serve your images directly from a CDN or image server. 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). Asset Flexibility: On-demand image resizing, even for images stored on remote.







Cdn image resize