I’m trying to setup Cloudflare as a reverse proxy but I don’t manage to make it work.
Goal is to use max-age without revalidation (once you cache it, serve it, don’t ask).
I have a PHP script that produces XML and sends the following headers (origin server):
It’s actually not true, I’m currently serving another website (with a different framework) through CF, and HTML is properly cached with the max-age headers
If it was true, the “Always online” feature (if origin server goes down, serve from CF) would be unrelevant.
I just don’t figure out how I manage to do this with another website (which uses Symfony) and not that one (raw PHP), despite headers and setup look identical.
Cloudflare caches XML responses when using Cache Everything . By default, jquery’s getScript explicitly bypasses cache by appending a timestamp query string unless the behavior is disabled. For further details on how to adjust Cloudflare’s behavior in regards to query strings, refer to our article on Understanding Cloudflare Caching Level.
From the second link:
Cloudflare only caches based on file extension and doesn’t cache by MIME type. The Cloudflare CDN automatically caches files containing certain file extensions and doesn’t cache HTML by default:
Always Online isn’t mentioned in either of the articles I linked to except as an ‘additional resource link’ at the end of the first.
DYNAMIC The resource was not cached by default and your current Cloudflare caching configuration doesn't instruct Cloudflare to cache the resource. Instead, the resource was requested from the origin web server. Use [Page Rules](https://support.cloudflare.com/hc/en-us/articles/200168306-Is-there-a-tutorial-for-Page-Rules-) to implement custom caching options.