Cloudflare and Cache-Control Behavior for Caching Full Web Pages

apache-2.2cachecloudflarereverse-proxyweb-server

I am experimenting with Cloudflare, mainly to relief the load of my webserver in peak moments. I just signed up and it seems to be working (all my traffic is being proxied) but Cloudflare does not seem to be caching anything.

My webserver is explictly sending Cache-Control headers that vary between 1 minute (i.e. Cache-Control: max-age=60, public) and 7 days. I was hoping that this way, my webserver would never be serving the exact same page twice within a minute. However, if I look at the apache logs of the web server, every request is directly proxied to the webserver, even when I request exactly the same resource several times in a minute.

Is this the expected behavior? How do I make CF serve cached versions of my website?

Best Answer

I actually work for CloudFlare & thought I would jump in.

-Please keep in mind that caching will take a few days to build out & it depends on the number of requests for the static resources.

-Another thing to keep in mind that we would only proxy what you have set in your DNS settings (orange cloud on the subdomain). If you have an images or CDN subdomain, for example, you would want to make sure it is both added in CloudFlare & covered with an orange cloud.