Cloudfront not sending If-None-Match to my origin

0

Hello! I'm trying to configure Cloudfront to send an If-None-Match to my origin when a resource expires, so that I can respond with a 304 if nothing has changed. For some reason, I'm unable to get Cloudfront to do so.

My origin responds with these headers:

HTTP/2 200 
content-type: application/json; charset=utf-8
content-length: 181691
access-control-allow-origin: *
cache-control: max-age=5
date: Fri, 17 Feb 2023 21:16:49 GMT
x-content-type-options: nosniff
x-frame-options: DENY
etag: W/"15-mbAPvGdFm9PuCZHJFTtrwm@3"
vary: Accept-Encoding

So, sending cache-control of 5 seconds and a weak e-tag.

My cloudfront cache policy has min ttl of 1, forwards headers Origin and a few x- ones, forwards all query strings. No cookies. Compression is turned on.

My origin request policy is "AllViewer".

For some reason, Cloudfront never sends an If-None-Match header to my origin when resource expires. If I manually specify an If-None-Match header in my request in a curl command to Cloudfront, my origin does see it and responds correctly. So there must be something wrong with my configurations.

Any ideas? I've been pouring over the documentations but have not found anything that worked.

Thanks!

  • It would seem the way you have this configured that the object would be removed/expired from the edge cache. Has that been confirmed just to verify that is happening?

Chung
질문됨 일 년 전66회 조회
답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠