今日已更新 353 条资讯 | 累计 21219 条内容
关于我们

Handling large images & files in a real time chat application

/u/omry8880 2026年06月01日 03:56 2 次阅读 来源:Reddit r/webdev

Hey guys, would love to get some feedback on whether my approach here makes sense. I’m building a real-time chat application where users can upload and receive images/files. Files can be fairly large (up to ~100MB). Current stack is: fastapi, websockets, tanstack, postgres and redis. I use GCP as my cloud provider. My current flow is: Backend generates a signed URL Frontend uploads directly to a GCS bucket A Cloud Function handles post-upload processing For downloads, the frontend fetches directly from GCS using redirects/signed URLs so the backend doesn’t become a bottleneck This architecture works great for smaller files (<30MB), but once I started testing larger uploads (100MB images/videos), I noticed very high memory consumption during processing (btw pagination & virtualization is used throughout the project). I’m trying to figure out what’s considered best practice here for large media uploads in chat systems: Should compression/downscaling happen client-side or server-side (currently there is not compression at all)? Also, Is it common to generate thumbnails/previews (for images) separately while keeping the original untouched? Should I stream uploads instead of buffering them? Are Cloud Functions even the right choice for heavy file processing? For images specifically, I’m considering: client-side compression before upload, automatic thumbnail generation, storing multiple resolutions, converting to formats like WebP/AVIF. Would love to hear how you guys handle this in production systems. Thanks! submitted by /u/omry8880 [link] [留言]

本文内容来源于互联网,版权归原作者所有
查看原文