#r2 convex image loading so long
4 messages · Page 1 of 1 (latest)
Hi @fading nimbus. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Loading images from R2 via Convex can be noticeably slower compared to using a CDN-backed solution. This is a known limitation at the moment. Currently, files served from Convex storage (including R2) do not benefit from a global CDN, so users far from the server region may experience higher latency. For example, community members have reported image load times of 800ms or more from Convex, while the same image served via Azure CDN or Supabase (which use CDNs) loaded in under 100ms in some regions. This difference is especially apparent for users outside the US, where Convex servers are currently hosted Image/file caching? Is there any caching for files on a CDN?.
Convex staff have acknowledged this and mentioned that while browser cache headers are set (so users shouldn’t have to download the same image twice), there is no built-in CDN or image optimization yet. They have plans to add CDN support and smarter caching in the future, but for now, images are served directly from storage every time, which can be slower than ideal Image/file caching? Is there any caching for files on a CDN?.
If you need faster image delivery right now, you can consider:
- Storing and serving lower-resolution images to reduce data transfer.
- Using an external CDN in front of your Convex storage URLs.
- Preloading images in your app to improve perceived performance.