After deploying a new frontend build, users still see the old JavaScript for hours.
BeginnerTroubleshootingRoute 53, CloudFront, API Gateway and Messaging
Answer
Likely causes → CloudFront (and browsers) cache the objects for the TTL set by the cache policy or by Cache-Control headers. Files with the same name, such as app.js and index.html, are not refetched.
Diagnose →
curl -sI https://www.example.com/app.js | grep -iE 'x-cache|age|cache-control|etag'
aws cloudfront list-invalidations --distribution-id E123ABC --max-items 3
Fix →
aws cloudfront create-invalidation --distribution-id E123ABC --paths "/index.html" "/app.js"
Prevent → Use content-hashed asset names (app.3f9c2.js) with long TTLs and immutable. Give index.html Cache-Control: no-cache (or a short TTL), and invalidate only index.html on deploy.
More on Route 53, CloudFront, API Gateway and Messaging
You created a public hosted zone and records for `example.com`, but `dig example.com` returns `NXDOMAIN` or old records.Beginner`InvalidChangeBatch: RRSet of type CNAME with DNS name example.com. is not permitted at apex in zone example.com.`BeginnerThe primary Region is down, but Route 53 failover records still send traffic to it.IntermediateA Route 53 health check reports `Failure: Connection timed out` for an endpoint that works fine from your laptop.IntermediateYou changed an A record an hour ago, but some users still reach the old server, and a newly created name returned `NXDOMAIN` for a while.AdvancedCloudFront returns `403 AccessDenied` (S3 XML) for every object after you switched the S3 origin to Origin Access Control.Intermediate