8. Summary: The Golden Rules of Object Storage + CDN
8.1 Architecture Design Principles
Principle 1: Separate Static and Dynamic Content
Dynamic content (API, HTML) → Route to origin or edge functions
Static content (images, JS, CSS, videos) → Route through CDN + object storagePrinciple 2: Serve Nearby
Content is cached wherever the users are
→ Choose a CDN provider with broad coverage
→ Enable intelligent DNS scheduling
→ Preheat important content in advancePrinciple 3: Layered Caching
Browser local cache (strongest)
↓
CDN edge node cache (second strongest)
↓
CDN mid-tier/regional node (fallback)
↓
Object storage/origin (last line of defense)Principle 4: Balance Cost and Experience
Storage tiering: Hot data on standard storage, cold data on archive storage
Cache strategy: Long TTL for high-frequency content, short TTL for low-frequency content
Compression optimization: WebP/AVIF formats, intelligent quality compression
Monitoring and alerts: Set bandwidth caps, prevent abnormal traffic8.2 Pitfall Checklist
Bucket Naming and Permissions
- [ ] Bucket names are globally unique; avoid name conflicts
- [ ] Private files should not be set to public read
- [ ] Don't write AccessKey in frontend code; use STS temporary credentials
- [ ] Enable server-side encryption (SSE) to protect sensitive data
CDN Cache Configuration
- [ ] HTML file TTL shouldn't be too long (recommended < 5 minutes)
- [ ] JS/CSS should use hashed filenames with TTL set to 1 year
- [ ] Cache keys should be reasonable; don't include user-specific variables
- [ ] Remember to purge cache or preheat after important updates
HTTPS Security
- [ ] Certificates must not expire; set up auto-renewal
- [ ] Minimum TLS version should be 1.2
- [ ] Enable HSTS to prevent downgrade attacks
- [ ] Set Secure and HttpOnly flags on sensitive cookies
Cost Control
- [ ] Enable bandwidth cap alerts to prevent abnormal traffic
- [ ] Infrequent Access/Archive storage has minimum storage duration and early deletion fees; be mindful of rules
- [ ] Origin fetch traffic is also expensive; work hard to improve CDN hit ratio
- [ ] Regularly analyze access logs and clean up zombie resources