Use stale-while-revalidate and 304 Not modified

Hello, Let’s say I have a resource that is fresh for a very short period, so it must be revalidated frequently: max-age=1, stale-while-revalidate=3600

During the revalidation, I’d like to avoid the origin to generate and send the full response if it has not changed. Is it possible to return a 304 Not Modified response to let Cloudflare know that the stale object can continue to be used?

1 Like



Your Origin needs to send valid Last Modified or ETag headers, so that there is something for Cloudflare to validate against.


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.