Using CloudFlare with WordPress

We’ve recently started using the CloudFlare service on WPMayor, and are very happy with it. For those who haven’t heard of it yet, CloudFlare is a FREE system that acts as a proxy between your visitors and our server. By acting as a proxy, CloudFlare caches static content for your site, which lowers the number of requests to our servers, but still allows visitors to access your site.

There are several advantages of the CloudFlare system:

  • Site performance improvement
    CloudFlare has proxy servers located throughout the world. Proxy servers are located closer to your visitors, which means they will likely see page load speed improvements as the cached content is delivered from the closest caching box instead of directly off our server. There is a lot of research that shows that a faster a site, the longer a visitor stays.
  • Bot and threat protection
    CloudFlare uses data from Project Honey Pot and other third party sources, as well as the data from its community, to identify malicious threats online and stop the attacks before they even get to your site. You can see which threats are being stopped through your CloudFlare dashboard here: https://www.cloudflare.com/your-websites.html.
  • Spam comments protection
    CloudFlare leverages data from third party resources to reduce the number of spam comments on your site.
  • Lower CPU Usage
    As fewer requests hit your server, this lowers the overall CPU usage of your account.
  • New Site Stats
    You have good tools to evaluate human traffic coming to your site, but no insight into search engine crawlers and threats. With CloudFlare, now you do.

Where as most WordPress caching plugins focus on optimizing your database and server, CloudFlare optimizes at the network level. CloudFlare has partnered with the popular W3 Total Cache plugin and is included as an option in W3 Total Cache (W3TC). CloudFlare caches common static content file extensions, including JavaScript, CSS and images. The full list of what CloudFlare caches can be found here.

CloudFlare and W3TC’s missions are aligned: making sites perform as fast as possible. W3TC runs on your server and helps optimize your database and content production. After that, CloudFlare takes over and our globally distributed network ensures your site’s content is delivered as fast as possible while, at the same time, preventing attacks from harming your site.

While W3TC and CloudFlare have always worked synergistically, you can now manage several of the CloudFlare features directly from the W3TC control panel. The W3TC plugin now also will also ensure that your visitors’ IP addresses appear correctly in WordPress without your needing the CloudFlare WordPress plugin or the mod_cloudflare Apache module.

You can download the latest version of the W3TC and get the full CloudFlare integration. If you’re already a CloudFlare user, you’ll just need to enter your account information and API Key, which you can find on your CloudFlare Account page. If you haven’t yet signed up for CloudFlare, simply follow the sign up link from the W3TC interface and you can be up and running in about 5 minutes.

If you are using the CloudFlare WordPress plugin, you should currently use both plugins. The W3TC plugin doesn’t include the spam reporting functionality. We are working with the authors to get the spam reporting functionality incorporated.

If you are using the W3 Total Cache plugin, make sure to enter your Cloudflare details in the settings section. If you activate CloudFlare through W3TC, then you do not need to use the CloudFlare WordPress plugin as well.

Check out this tour of CloudFlare services if you’d like to know more about it.

Are you using Cloudflare on your WordPress site? Let us know what your experience has been, and if you’re not, we encourage you to give it a try!

If you enjoyed this post, make sure to subscribe to WPMayor’s RSS feed.

About Jean Galea

Jean Galea is a WordPress developer, entrepreneur and padel player. He is the founder of WP Mayor, the plugins WP RSS Aggregator and EDD Bookings, as well as the Mastermind.fm podcast. His personal blog can be found at jeangalea.com.

Related Articles

  • A forum on your website can increase visitor engagement and allow you to start a loyal community. There are a few WordPress forum plugins available. Let's take a look at…

  • Translating plugins and themes into other languages apart from English is all the rage these days as WordPress usage booms across the globe. After all English is not even the…

  • Strategies for Selling WordPress Plugins

    Over on my personal blog I've shared some strategies that have worked for us when selling WordPress plugins. I invite you to check out that post (which I'll be updating…

16 Responses

  1. Piet
    Piet January 19, 2012 at 04:20 | | Reply

    Interesting article, Jean. So basically you need to change DNS servers if you want to enable the Cloudflare service? What I don’t understand though is that if you route everything through them, how will your databases be updated then or am I having a brain failure now and am I completely mixing things up?

    1. Damon Billian
      Damon Billian April 10, 2012 at 00:11 | | Reply

      “What I don’t understand though is that if you route everything through them, how will your databases be updated then or am I having a brain failure now and am I completely mixing things up?”

      You still update these as you do today (through your hosting provider). Your hosting provider doesn’t change if you’re using CloudFlare in front of your site.

  2. Ivica
    Ivica April 8, 2012 at 20:27 | | Reply

    Hi! Can you tell me do you know how Cloudflare service is working with WP web shop plugins (e.g. Jigoshop)? Namely, web shop plugins don’t “like” much caching plugins (like W3 Total Cache), in fact they can’t work together at all, according to peoples’ experiences.

    1. Damon Billian
      Damon Billian April 10, 2012 at 00:13 | | Reply

      “Hi! Can you tell me do you know how Cloudflare service is working with WP web shop plugins (e.g. Jigoshop)? Namely, web shop plugins don’t “like” much caching plugins (like W3 Total Cache), in fact they can’t work together at all, according to peoples’ experiences.”

      Should be fine because we’re not a plugin (we cache static content by file extension type). The primary concern would be SSL, if you’re using it, which would require upgrading to a Pro account for SSL to work. You would also want to install the CloudFlare WordPress plugin to make sure original visitor IP is restored at WP level.

      1. Ivica
        Ivica April 10, 2012 at 00:21 | | Reply

        Thank you Damon for your answer. We can try and see how it is going… BTW, we are not using SSL.

  3. Rusola
    Rusola April 8, 2012 at 20:28 | | Reply

    How does this work in relation to the european cookie law? Does it use 3rd party cookies? How do I avoid this to stay compliant?

    1. Damon Billian
      Damon Billian April 10, 2012 at 00:15 | | Reply

      We currently don’t have a solution for the EU cookie law. We will likely build an app to help users address these issues in that region.

  4. Richard Guay
    Richard Guay June 28, 2012 at 15:48 | | Reply

    Hi,

    Nice article. I just started using CloudFlare from my host provider, DreamHost. One click and it was all done. I also run W3TC and gave it my CloudFlare credentials. Ever since then, the frontend does seem to load faster, but the admin screens seem to be slower than before. Has anyone else experienced this?

  5. Damon Billian
    Damon Billian June 28, 2012 at 20:35 | | Reply

    Hi,

    I would recommend excluding the admin section of the site with a PageRule. Details here: http://blog.cloudflare.com/introducing-pagerules-fine-grained-feature-co

    Some performance features can inadvertently impact features in admin backends.

    1. Richard Guay
      Richard Guay June 29, 2012 at 03:06 | | Reply

      Thanks Damon, that really did help!

  6. Damon Billian
    Damon Billian June 29, 2012 at 20:55 | | Reply

    Glad that did the trick!

  7. Tim Hyde
    Tim Hyde January 10, 2013 at 10:41 | | Reply

    I’ve been using CloudFlare on a couple of my sites for about 12 months on the Pro level.

    It was very easy to set-up. Their install wizard guides you through. Generally it has worked well, protecting the server and reducing load.

    On sites that have not been optimized it can have a dramatic effect on load times and responsiveness of site. The free level is certainly an easy and cheap way to get some cdn.

Leave a Reply