Soru

Zorluk: OrtaHigh-Performing Content Delivery and Caching Solutions

A digital publishing company hosts a web application where users download magazine issues and static images. The files are stored in an Amazon S3 bucket. To reduce download latency and S3 data transfer costs, the company deployed an Amazon CloudFront distribution in front of the S3 bucket. However, during a peak traffic event, the backend database and S3 bucket experienced high loads, and reports showed a CloudFront cache hit ratio of 0% for the static assets.

Which configuration issue explains why the static assets are not being cached at the edge locations?

  1. The cache policy associated with the CloudFront cache behavior for static assets has its Minimum TTL, Maximum TTL, and Default TTL values set to 0 seconds.Cevap
  2. B
    The S3 bucket hosting the static assets is configured to transition objects to S3 Standard-Infrequent Access (S3 Standard-IA) immediately upon creation, which restricts caching.
  3. C
    Amazon Route 53 is configured with a latency routing policy that redirects user requests directly to the regional S3 bucket endpoints, bypassing the CloudFront caching layer.
  4. D
    The application database is configured to store static asset download logs in Amazon DynamoDB using partition keys structured as monotonically increasing timestamps.

Cevap

The cache policy associated with the CloudFront cache behavior for static assets has its Minimum TTL, Maximum TTL, and Default TTL values set to 0 seconds.
Specifying a TTL of 0 seconds on a CloudFront cache behavior tells CloudFront not to cache the objects retrieved from the origin. This results in a cache hit ratio of 0% and sends all requests directly to the origin S3 bucket, causing increased latency and higher data transfer costs.

Adım Adım Çözüm

1
Analyze the symptom of a 0% cache hit ratio on CloudFront.
A 0% cache hit ratio indicates that CloudFront is forwarding every single incoming request for the static assets directly to the Amazon S3 origin instead of retrieving them from edge caches.
This identifies that the issue lies in the caching configuration (TTL) of the CloudFront distribution itself.
2
Evaluate how TTL settings control CloudFront caching behavior.
Setting the Minimum TTL, Maximum TTL, and Default TTL to 0 seconds in the CloudFront cache policy ensures that objects are never cached at edge locations.
This configuration forces CloudFront to fetch static content from S3 on every request, completely bypassing edge cache storage.
3
Rule out incorrect architectural changes.
S3 storage classes, Route 53 routing policies, and DynamoDB partition key structures do not control CloudFront's edge caching behavior.
While these factors affect cost, routing, and database performance respectively, they are unrelated to the CloudFront distribution's cache hit ratio.

Anahtar Kavram

CloudFront cache policy TTL settings
Tahmini Süre:1m 30s
Bu soruyu puanla