Overview

If you have a WordPress site running through CloudFlare, you can explicitly tell CloudFlare to cache the pages as well as the static media. By default, only the static media will be cached. This is because CloudFlare defaults to the safest option to ensure it doesn’t cause issues for your site. However, if you want to also cache content with CloudFlare, you can explicitly tell it to cache your pages as well.

CloudFlare have a detail page on the topic here: https://support.cloudflare.com/hc/en-us/articles/202775670-How-Do-I-Tell-CloudFlare-What-to-Cache-

Instructions

You need to install and configure W3 Total Cache first before proceeding. You can read our guide on this here.

  1. Login to the WordPress Admin, then go to Performance -> Browser Cache.
  2. Enable the option for “Set cache control header”:
    wordpress - w3 total cache - set cache control header
  3. Click “Save all settings”.
  4. In a different browser or “Incognito” mode, open the site and view the server headers. You should now see the following:
    wordpress - w3 total cache - browser headers
  5. If you see a header as above, the settings are now correct and CloudFlare will keep a copy of the site cached.
Was this article helpful?

Related Articles