What should I do if I'm expecting a surge or spike in traffic?

Make sure your site can handle traffic spikes by doing the following:

1. Contact your hosting provider to understand the limits of your hosting plan

 Even though CloudFlare offsets most of the load to your website via caching and request filtering, a certain amount of traffic will still pass through to your host. Knowing the limits of your plan can help prevent a bottleneck from your hosting plan.  

2. Reduce the number of unwanted requests to your infrastructure.

 CloudFlare allows you to block IP address individually or IPs from entire regions. If you don’t want or need traffic from certain IPs or regions, you can block them using your Threat Control panel. This is useful for sites who know where their visitors usually come from.

For example, if you run an ecommerce site with customers only in the US, you might want to block all other regions to prevent possible attacks from those parts of the world.

3. Use CloudFlare IP addresses to your advantage

Take action to prevent attacks to your site during peak season by configuring your firewall to only accept traffic from CloudFlare IP addresses during the holidays. If you only accept CloudFlare IPs, you can prevent attackers from getting to your original IP address and knocking your site offline.

4. Ensure CloudFlare IPs are whitelisted

CloudFlare operates as a reverse proxy to your site so all connections come from CloudFlare IPs, so restricting our IPs can cause issues for visitors trying to access your site. The list of our IP can be found here: https://www.cloudflare.com/ips

5. Go beyond default caching for the fastest site possible

 By default CloudFlare caches static content with our CDN; however, you can extend our caching through Advanced Caching, Edge Caching, and by creating custom Page Rules.

Under the Page Rules section of your account, you can set a pattern--either your entire website, or a section of your site--then turn on the “Cache everything” option. Creating a page rule and setting the Cache Everything option helps reduce the number of times CloudFlare has to hit your origin to download cacheable items.

Setting up a custom Page Rule like this is ideal if you have a campaign going on over the holiday season. With the Cache Everything option enabled, CloudFlare will be serving your entire site, taking the load off of your server completely, making you site as fast as possible.

On this same page you can change the Edge Cache Expire TTL and the Browser Cache Expire TTL. These features allow you to determine how long we cache resources at our edge, and how long browsers will cache assets.

6. Make sure your back-end analytics are accurate

 To ensure visitor’s IPs show in your back-end server logs you can install mod_cloudflare to restore original visitor IP back to server logs. Our IP addresses will show up in your logs unless you install the modification to make sure you are logging the visitors’ actual IP addresses.

 Additional Tips:

  • Domains on a paid CloudFlare plan have more Page Rules than a domain on a free account.
  • We generally recommend turning CloudFlare off in the admin section of your site with a Page Rule. Some optional performance features and apps could inadvertently break some functions in the admin section of your site.

 

 

Still not finding what you need?

The CloudFlare team is here to help. 95% of questions can be answered using the search tool, but if you can’t find what you need, submit a support request.

Powered by Zendesk