CDN (Content Delivery Network) — geographically distributed servers serving static content from the node closest to the user. For a standard site setup takes 30 min: register at Cloudflare (free), switch DNS, enable proxy, set cache rules. For RU — Yandex Cloud CDN (DC in Moscow).
Below: step-by-step, working examples, common pitfalls, FAQ.
curl -I https://example.com | grep -i "cf-cache-status" → "HIT"| Scenario | Config |
|---|---|
| Cloudflare Page Rule for cache | URL: example.com/static/* → Cache Everything + Edge Cache TTL: 1 year + Browser Cache TTL: 1 year |
| AWS CloudFront distribution | Origin: your-bucket.s3.amazonaws.com
Alternate Domain Names (CNAMEs): cdn.example.com
Default Cache Behavior: Redirect HTTP to HTTPS + Cache based on Host header |
| Yandex Cloud CDN | Create CDN resource → Primary origin: origin.example.com
Edge locations: Moscow + Saint-Petersburg
SSL: Let's Encrypt or custom cert |
| nginx origin behind CDN | real_ip_header CF-Connecting-IP;
set_real_ip_from 173.245.48.0/20; # Cloudflare IP ranges |
| Cache bust via query param | https://example.com/style.css?v=1776446434 # filemtime hash auto-bust |
Cloudflare: global coverage, free, but not every Russian ISP routes optimally. Yandex: tier-1 RU coverage + compliance, paid from 0.5₽/GB.
International client TTFB: 300-800ms → 50-150ms. LCP: 10-40% improvement depending on content.
Cloudflare: Dashboard → Caching → Purge Cache (all or by URL). AWS: Invalidation in CloudFront console. Yandex: Prefetch/Purge API.
Yes. Google uses TTFB + Core Web Vitals. Fast CDN → better CWV → +10-20% visibility.