alancc
alancc

Reputation: 811

Will Cloudfront Cache 404 status code when server returns "no-cache, must-revalidate, max-age=0"?

I just wonder whether Cloudfront will cache 404 status code if my server return cache-control header with "no-cache, must-revalidate, max-age=0"? I check this document https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/HTTPStatusCodes.html#HTTPStatusCodes-cached-errors, but it only said Cloudfront will cache when "Your origin returns an HTTP 4xx status code that is not restricted by a cache control header", which implies that they will not cache if cache control header is set.

Upvotes: 1

Views: 1428

Answers (1)

Clinton Bosch
Clinton Bosch

Reputation: 2589

Contrary to the comments, the documentation clearly states that 404 is in fact always cached.

See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/HTTPStatusCodes.html#HTTPStatusCodes-cached-errors

Upvotes: 1

Related Questions