ladderlore
请求新指南
  • 输入服务名称,例如 S3 或 IAM。

概念 · 基于 CLF-C02

CDN and edge caching for cost

A CDN pays off when many requests are served from cache. Tune the hit ratio and the price class.

本课尚未翻译,暂以英文显示。

你在云从业者中已学过

  • CloudFront caches content at edge locations.
  • Users get lower latency.
  • It works with S3 and other origins.
阅读云从业者课程
Users
CloudFront
Origin Shield
S3HitMissFetch
A hit stays at the edge. A miss goes through Origin Shield.
  • CloudFront

    Helps by
    Caching near users
    Cost shape
    Per GB out and requests
  • Global Accelerator

    Helps by
    Faster routes, static IPs
    Cost shape
    Hourly plus per GB
  • Route 53

    Helps by
    Naming and routing
    Cost shape
    Per query, alias free
Three edge services and their cost shape.

是什么

CloudFront egress costs less per GB than sending the same data directly from EC2 or S3, and traffic from an AWS origin to CloudFront is free. Each cache hit also saves a request to the origin. So it lowers cost when content repeats: images, scripts, video and downloads. For one-off or private data it adds little.

是什么

Raise the cache hit ratio with longer TTLs, fewer cache key variants (limit the query strings, headers and cookies in the key) and compression. Origin Shield adds a central cache layer in front of the origin, so misses from many edge locations become one request. It costs per request, and helps most when the origin is slow or costly. Price classes limit which edge locations serve you. Price Class 100 uses the cheapest locations, in North America and Europe. Price Class 200 adds more Regions, and All uses every location. Fewer locations lowers the price and raises latency for far-away users.

是什么

Other edge services have a different cost shape. AWS Global Accelerator has an hourly fee plus a per-GB premium. It speeds up and steadies traffic over the AWS network, and gives static IP addresses, but it does not cache, so it is not a way to cut cost. Amazon Route 53 bills per hosted zone and per million queries. Alias records that point to AWS resources, such as CloudFront and load balancers, are free to query. CNAME records are billed. Longer TTLs mean fewer queries.

要记住

  • CloudFront pays off with repeated content and a high cache hit ratio.
  • Transfer from an AWS origin to CloudFront is free. CloudFront egress is usually cheaper than direct egress.
  • Raise the hit ratio: longer TTLs, small cache keys, compression.
  • Origin Shield: an extra cache layer that cuts origin requests. It bills per request.

要记住

  • Price classes: fewer edge locations, lower price, higher latency far away.
  • Global Accelerator is for performance, not cost. Route 53 alias queries to AWS resources are free.

考试中

  • “Global users download the same static files, reduce egress cost” points to CloudFront.
  • “Many edge locations hit one slow origin” points to Origin Shield.
  • “Most users are in North America and Europe, lower the CDN cost” points to Price Class 100.
  • “Static IP addresses and faster routing for TCP or UDP, no caching” points to Global Accelerator.