CloudFlare is a FREE reverse proxy, firewall, and global content delivery network and can be implemented without installing any server software or hardware.
On average, CloudFlare-powered websites load 30% faster, use 60% less bandwidth, and process 65% fewer requests. CloudFlare-powered websites are protected from many forms of malicious activity including: comment spam, email harvesting, SQL injection, cross-site scripting, and DDoS (denial of service) attacks.
That sounds fine and dandy, but can I see the performance of CloudFlare-enabled site?
Sure, visit my site: Brian Stevenson.
7.x Branch
7.x Functionality
- Corrects
$_SERVER["REMOTE_ADDR"]so it contains the IP address of your visitor, not CloudFlare's reverse proxy server. - Integrates with CloudFlare's Threat API so you can ban and whitelist IP addresses from the Drupal Comment administration screen.
- Integrates with CloudFlare's Spam API.
- Integrates with CloudFlare's Client Interface API (planned).
How do I get started with CloudFlare?
- Visit http://www.cloudflare.com to sign up for a free account.
- Follow their 5-minute configuration wizard.
Installation Instructions 7.x
- Install and Enable this module.
- Assign permissions to administer module (if you are not logged in as the user 1, admin)
- Add code at the end of your settings.php file:
if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
} - Save your email address and CloudFlare API key to the CloudFlare administration screen on your Drupal web site (admin/settings/cloudflare).
How do I use this module?:
Presently you can submit Spam reports & ban/whitelist IP addresses from the Comment Administration section (/admin/content/comment). Look for the "Update Options" drop down listbox and choose one of the available CloudFlare Actions.
About the maintainer:
This module was sponsored by yadaDROP LLC, a Drupal Development company.
8.x Branch
The CloudFlare module has been built from the ground up for D8. It provides integration with the CloudFlare CDN using the CloudFlare API see: https://api.cloudflare.com/
8.x Current Features
- Cache clearing by Tag (Recommended) and Path.
- Restore client's original IP address.
8.x Getting Started
drush dl cloudflare purge --yes- From the root of your site run install composer dependencies:
composer require d8-contrib-modules/cloudflarephpsdk "1.0.0-alpha1" - To install:
drush en cloudflare cloudflarepurger purge purge_ui purge_drush purge_queuer_coretags purge_processor_cron --yes - Note: If you try to install purge, cloudflare and cloudflare_purger all at once via the UI you will get a one time error on install. This is known issue that is impacting other D8 modules. See
here
here and here. If you are installing via the UI, recommend the following discrete steps:- install purge
- install cloudflare
- install cloudflarepurger
- install purge_ui purge_drush purge_queuer_coretags purge_processor_cron
drush cr- Go to
admin/config/services/cloudflareand enter your cloudflare API credentials. - In most environments you will get the CloudFlare edge server ip returned by default. By checking
Restore Client Ip Addressthe module can restore the original client IP address on each request. - Under
Host to Bypass CloudFlareyou can specify a host used for authenticated users to edit the site that bypasses CloudFlare. This can help suppress watchdog warnings regarding requests bypassing CloudFlare. - Head over to
/admin/config/development/performance/purge - Click "Add purger" and select "CloudFlare".
- Click "Add".
- Now you are ready to go!
Disclaimers
-
Multi-Zone Support
The module does not yet support cloudflare accounts with multiple domains/zones. There is a prioritized issue here -
API Rate Limit
The current CloudFlare API only supports 200 tag purge requests/day which makes it unsuitable for a production site. It's our hope that the limit will be raised in the near future. -
Cache Tag Header Size
Currently CloudFlare does not support 16k cache tag headers which are necessary for taking full advantage of D8's cache tag system.The current module and CloudFlare itself use a bloom-filter based approach to work around this limitation. They limit the number of possible cache tags to 4096 tag. However, that means that purging one tag can result in other tags and therefore pages being inadvertently purged. This makes the module unsuitable for high-traffic events.
-
Varnish
The CloudFlare purger has been built as a plugin to the Purge module.
At this time no Varnish purger plugins have been written for the Purge module. They are coming soon! We expect Varnish and Acquia Purge D8 purge plugins to appear sometime in the first half of 2016.
Dependencies
-
The module relies on the CloudFlarePhpSdk for all interactions with the
CloudFlare API. You can check it out here. -
The CloudFlare Purger submodule also relies upon the Purge module for all cache expiration/purging.
Legal
CloudFlare is a trademark of CloudFlare Inc. This module has not been built,
maintained or supported by CloudFlare Inc. This is an open source project with
no association with CloudFlare Inc. The module uses their API, that's all.
Project Information
- Maintenance status: Actively maintained
- Development status: Under active development
- Module categories: Performance and Scalability, Security, Spam Prevention, Third-party Integration
- Reported installs: 2,434 sites currently report using this module. View usage statistics.
- Downloads: 14,922
- Last modified: December 23, 2015
Downloads
Recommended releases
| Version | Download | Date |
|---|---|---|
| 8.x-1.0-alpha1 | tar.gz (30.44 KB) | zip (52.37 KB) | 2015-Dec-22 |
| 7.x-1.0-beta4 | tar.gz (11.24 KB) | zip (11.83 KB) | 2013-Dec-27 |
| 6.x-1.0-beta4 | tar.gz (11.05 KB) | zip (11.61 KB) | 2013-Dec-27 |
