How to use Cloudflare with Agility to Handle Traffic Spikes

Joel Varty
Joel Varty
How to use Cloudflare with Agility to Handle Traffic Spikes

We spend a lot of time and hard work to try and drive traffic to our websites. Sometimes it works, with that perfect shout out on Instagram from a major influencer, or a celebrity re-tweet, or it could just be a case where your content has gone viral. Sometimes it pays off so well you run into a situation where your web traffic instantly spikes to a thousand times higher than you expect.

One of our customers experienced that when they had a major announcement about their Olympic hockey team. It caught everyone off guard and it took some time for the site to autoscale out to where it needed to be to handle that traffic. In a cloud-based world, it's nice to have the scale ready when you need it, but a vast majority of the traffic might happen in only a few minutes. If the website isn't responsive with sub-second load times, you might just lose that audience you've worked so hard to acquire.

Enter Cloudflare - the agile CDN that's perfect for handling these kinds of traffic spikes. Actually, calling Cloudflare merely a "CDN" is a bit misleading, as it also serves a Web Application Firewall (WAF), provides DDoS protection and perhaps most interestingly, has a unique feature called "Workers" that allows you to write simple Javascript logic that runs right on their Edge servers.

Our customer wanted to add up-to-the-minute game stats and news on their site, which provided a particular development challenge for their implementation partner. The original version of the website didn't handle these live stats, and it would take a major code rewrite to handle these stats.

I suggested using Cloudflare, and my team personally took on the challenge of configuring and coding the "Workers" in Javascript, as we found them a really interesting technology. The customer signed up for a "Pro" Cloudflare account - only $20 a month, and we added support for
"Workers" - an additional $5 a month.

The results were immediate and amazing. Our customer was able to redirect their traffic on their Agility website to Cloudflare, with the live stats pages only being cached for 1 minute. The home page and the news pages are cached for 5 minutes, and the rest of the site is cached based on default settings, which is much longer.

How did things turn out? Pretty great, just check out the numbers!

Nominal traffic on this website is about 100k daily views from 40k user. Previously, our partner had seen the server CPUs flatline at 100% when the number of views hit 500k. Well, after putting Cloudflare in place during a popular game this past month, we saw traffic hit nearly 1.5 million daily views, with over 550k users hitting the site in a 24-hour period. Response time on the site stayed quick with sub-second response on over 98% of requests. What's even better? The CPUs on the web servers hovered around 25-30%.

Want to know more about how Agility and Cloudflare work together?

Talk to us!

Joel Varty
About the Author
Joel Varty

Joel is CTO at Agility. His first job, though, is as a father to 2 amazing humans.

Joining Agility in 2005, he has over 20 years of experience in software development and product management. He embraced cloud technology as a groundbreaking concept over a decade ago, and he continues to help customers adopt new technology with hybrid frameworks and the Jamstack. He holds a degree from The University of Guelph in English and Computer Science. He's led Agility CMS to many awards and accolades during his tenure such as being named the Best Cloud CMS by CMS Critic, as a leader on G2.com for Headless CMS, and a leader in Customer Experience on Gartner Peer Insights.

As CTO, Joel oversees the Product team, as well as working closely with the Growth and Customer Success teams. When he's not kicking butt with Agility, Joel coaches high-school football and directs musical theatre. Learn more about Joel HERE.

Share Post

Take the next steps

We're ready when you are. Get started today, and choose the best learning path for you with Agility CMS.