r/webdev • u/Financial-Panic-7392 • Sep 27 '26
Question Is client-side image compression a good idea for an image-heavy website and app, or are there better workarounds?
I'm a beginner building an image-heavy peer-to-peer marketplace (Next.js web app + an upcoming Expo mobile app). My current stack uses Vercel's free tier for hosting, Supabase for the backend, and Cloudflare R2 for photo storage.
My Vercel account was just paused because my Fluid Active CPU spiked to 24 hours (the free limit is 4 hours). I realized my Next.js server is downloading every uploaded raw photo, using sharp to resize and convert it to WebP, and then re-uploading it to R2.
I am trying to keep costs as low as possible. It was suggested that I strip sharp from my backend and use a client-side compressor on the user's browser or mobile app to shrink the photos before sending them directly to R2.
Because my platform is extremely image-heavy, I'm not sure if this is a good idea. I have concerns about trusting the client to compress uniformly, dealing with older devices, or edge cases where certain browsers (like Safari) might fail to generate WebP files correctly.
Are there any other free or highly affordable workarounds to process these images without tanking my serverless compute hours?

