performance
CDN.
Content Delivery Network, edge cache, origin, 프론트엔드 배포 관점
CDN은 전 세계 edge PoP에 static/API 응답을 캐시해 사용자와 지리적으로 가깝게 제공합니다.
🔄 동작
- User → nearest edge
- Cache HIT → edge가 즉시 응답
- MISS → origin (서버/storage) fetch → edge에 cache → user
📦 캐시 대상
- static: JS, CSS, font, image (hash filename → long TTL)
- HTML: SSG/ISR 페이지
- API:
Cache-Control, CDN cache rules (주의: personalized API)
🚀 프론트 배포 (Vercel, Cloudflare, Netlify)
- git push → build → edge 배포
- Preview URL, instant rollback
- Image Optimization, Brotli, HTTP/3 often included
⚙️ 헤더/설정
Cache-Control,CDN-Cache-Control(provider별)- Stale-while-revalidate at edge
- Purging: 배포 시 cache invalidate
🔗 참고 자료
- web.dev: Content delivery networks — CDN이 지연을 줄이는 방식을 설명한다.
- MDN: HTTP caching — 브라우저와 공유 캐시, Cache-Control을 정리한다.
- RFC 9111: HTTP Caching — HTTP 캐싱 표준 명세다.
- MDN: Cache-Control — Cache-Control 지시어 레퍼런스다.
