Networking and Content Delivery

A CloudFront distribution lists /images/* before /images/private/* in its ordered cache behaviors; only the latter uses the CachingDisabled policy. Requests for /images/private/logo.png still receive cached responses. Which change fixes this without disabling caching for other images?

Show the answer

Correct answerD. Move /images/private/* before /images/*.

AWhy not this: An origin request policy does not change which cache behavior matches a request.

BWhy not this: The default behavior is used only when no ordered path pattern matches.

CWhy not this: Invalidation removes cached objects but leaves requests matching the caching-enabled behavior.

DWhy this is right: The private path must match before the broader images path for its caching policy to apply.

CloudFront applies the first matching ordered cache behavior, not the most specific path pattern. Moving the private path first applies CachingDisabled; invalidation alone removes existing objects but permits caching again under the broader behavior.