jd
CDCloudflare Developers
•Created by jd on 8/22/2024 in #general-help
Optimize performance of serving many images
What's your recommendation on serving large amount of images with CF ? I currently have them stored in R2 with file sizes range from 20 ~ 150kb each, with pre-signed URL on the server side (EC2) returned to client to fetch images.
Problems I noticed are presigning takes too long and probably im also not leveraging CDN from CF. One of my primary concern was not to put image storage bucket public by default, thus better gated and tried pre-signing url.
With CF, maybe the best option going forward is to have a CF worker binding with R2 bucket, intercept all image access requests, do simple verification, cache CDN and fetch the image directly to client? Thanks!
6 replies