ADR 0005: Media Distribution — Cloudinary Fetch from COS¶
Status¶
Accepted
Date¶
2026-07-24
Context¶
OVES serves promotional content, social media campaigns, website images, and product visuals globally. Cloudinary is the existing media service provider (subscription retained). Raw originals need a permanent home — previously scattered across Cloudinary storage, S3, and local disks.
The question: should Cloudinary store originals, or should COS be the single source of truth with Cloudinary as the transformation/delivery layer?
Decision¶
COS is the single source of truth for all raw media. Cloudinary fetches from COS and serves transformed versions via global CDN.
Architecture¶
Upload → COS (raw master, permanent)
│
├──→ Tencent CDN (China users, free intra-region)
│
└──→ Cloudinary fetch (global users, on-the-fly transform)
Delivery Routing¶
| Audience | Delivery | Rationale |
|---|---|---|
| China users | Tencent CDN (direct from COS) | Free intra-region, < 5ms latency |
| Global users | Cloudinary fetch from COS → transform → global CDN | Existing Cloudinary subscription, best ex-China coverage |
Fetch Mode¶
Cloudinary's fetch delivery type pulls from a COS presigned URL, applies transformations, caches the result on Cloudinary's CDN, and serves it. No permanent storage on Cloudinary.
COS presigned URL → Cloudinary fetch → {width: 800, format: "webp"} → CDN
Cold-Fetch Mitigation¶
First request per asset incurs a 1–15s cold-fetch penalty (COS → Cloudinary server → CDN). Mitigation:
- Warm-up request after upload: trigger a fetch to populate CDN cache
- Auto-upload mapping (future): if Cloudinary supports S3-compatible COS endpoints, auto-upload on first request for permanent Cloudinary-side storage
Consequences¶
Benefits¶
- Single source of truth (COS) — originals never duplicated across platforms
- Cloudinary handles format negotiation, responsive sizing, CDN delivery
- No egress cost between COS and Tencent CDN for China users
- Clean separation: storage ≠ delivery
Trade-Offs¶
- Cold-fetch latency (1–15s) on first global request per asset — mitigated by warm-up requests
- Cloudinary auto-upload mapping with COS is untested (COS is S3-compatible but not officially supported by Cloudinary's auto-upload feature)
- Dual CDN (Tencent + Cloudinary) adds minor configuration complexity
Supersedes¶
None.
Superseded By¶
None.