Response from origin server and CF doesnt match

Im setting the below headers in my Origin server

“Cache-Control”, “public, must-revalidate, max-age=300”

Basically, im instructing the browser here to cache the response for 5 minutes. Along with these headers - i also send an etag across

After 5 minutes , I get the latest request and check its Etag headers - if they match , my origin server sends back an HTTP 304

But cloudflare isn’t proxying back an HTTP 304 but an HTTP 200 back to the browser making the browser download the response again despite there being no change

These are the response headers i get back from cloudflare

  1. cache-control:

public, must-revalidate, max-age=300

  1. cf-cache-status:

REVALIDATED

  1. server:

cloudflare

  1. status:

200

  1. vary:

Accept-Encoding

But i can see from my server logs that there is an HTTP 304 sent back -

Why is CF still sending an HTTP 200 to my browser. Is there something i need to modify in my cache headers?

This topic was automatically closed after 30 days. New replies are no longer allowed.