Same root cause as the shop logo fix: these two routes still expected
req.files.<field> (the removed express-form-data pattern) with no
multer middleware in front of them, so:
- POST /shop-chat/:shopId/messages/file always rejected with "فایل
الزامی است" even when a valid image/video was sent.
- POST /chat-rooms room creation silently dropped room_image, and
would lose all text fields (title, visibility, ...) whenever the
request was multipart (i.e. whenever an image was attached).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Resize/re-encode every uploaded image server-side (posts, avatars, stories,
shop products/logo, chat messages) via a shared sharp-based optimizer —
caps dimensions to what's actually displayed and re-compresses in place,
cutting a typical raw camera photo by ~90% with no visible quality loss
- Cap uploaded video resolution/bitrate (re-encode only when above 1280px/
~2.5Mbps) alongside the existing faststart step; apply faststart+cap to
story and chat videos too (previously stored completely raw)
- Add long-lived Cache-Control to all /storage static routes so clients stop
re-downloading unchanged media on every request
- Add gzip/brotli compression for JSON API responses (feed/explore/chat)
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>