A static site on CloudFront must serve a corrected file immediately everywhere. Which approach avoids stale edge copies most reliably?
Correct answer
D. Version the object key, such as app-v2.js, so the CDN path itself is new and uncached
11 views
D. Version the object key, such as app-v2.js, so the CDN path itself is new and uncached
11 views
Cache busting by changing the object key makes every edge location treat the file as a brand-new object, so no invalidation is needed and the first request already misses. Invalidations work too but are limited in number and take time to propagate, while lowering max-age only bounds staleness without removing it. Versioned filenames are why build tools emit hashed asset names.
Asked in: NTS, PPSC IT, Campus Interviews
Not sure why the answer is D? Ask here and get an explanation.