Cloudflare Caching and Protection with Magento 2

If you own or operate a Magento 2 eCommerce site, you almost certainly have spent time trying to improve performance and load speed. Magento 2 is a powerful eCommerce solution, but it is also complex and resource intensive, even on a “vanilla” installation. You can get a powerhouse web host, enable multiple levels of front-end and back-end caching, and integrate powerful search tools to try to improve performance. Those efforts will get you much of the way there, but not all the way.

If you haven’t already setup a Content Delivery Network (CDN) for your site, it is often “low-hanging fruit” for improving the performance and load speed for Magento 2. A CDN is a distributed network (i.e. the servers that house the data are geographically distributed so that they will be closer to the user) designed to provide fast delivery of website content that doesn’t need to change every time the site loads (think images and other “static” assets). CDNs speed up delivery of HTML pages, JavaScript, styles, images, videos, and any other media your site uses to display its content. CDNs are a significant benefit for mobile page load speeds, which can be difficult to improve, but are consistently becoming a more significant part of every website’s traffic.

We have used a number of CDN systems in the past on various Magento stores that we manage for clients. I wanted to highlight one in particular today that includes all of the standard performance improvements that come along with CDNs, and also some security tools that can help you combat malicious behavior by malicious site users.

Cloudflare is a big name in the CDN space for a variety of reasons. They offer a full-featured free introductory plan which includes common CDN features as well as some powerful security tools.

Budget is tight, what can I get for free on Cloudflare?

Cloudflare offers a pretty solid free CDN service for budget-conscious site managers. The free plan includes the global CDN, which can help by improving load times by caching all of your site assets, reducing your bandwidth costs, and increasing your site availability by introducing redundancy on global networks.

Rather than users being served static content directly from your host server, the Cloudflare CDN provides the primary access point. Your Magento 2 install routes through the CDN using internet exchange points, which are locations where ISPs route internet traffic. This essentially puts your static content much closer to your site visitors, improving load speeds, which ultimately improves your bounce rates and conversions.

Cloudflare DDOS Protection

The 2nd freebie you get with Cloudflare is actually pretty huge: DDoS (Distributed Denial of Service, which essentially floods your site with bot traffic to make it unusable by actual customers) protection. We were recently dealing with some malicious behavior on a site where malicious actors were abusing the checkout system to test credit card data. Card testing is unfortunately common on Magento 2. This type of behavior can be costly to site owners, who in turn must deal with unhappy payment processors who hold site owners responsible for the abuse of their payment systems.

With Cloudflare DDoS protection, you get a huge leg up on combating this bad behavior. Cloudflare takes a multi-layered approach to dealing with this. Layer 7 protection is the top layer of protection, or the ‘application layer’. This is where most HTTP traffic (server requests and responses) occurs. Cloudflare intelligently filters this traffic to protect against attacks.

The 2nd layer is called the Transport layer, and Cloudflare protects at this layer using special proxies that intercept DDoS attacks across multiple vectors (think of this like a series of bodyguards between your network traffic and your site visitors).

The 3rd layer of protection is the Network layer, which is internet traffic across global networks. Cloudflare filters and ‘sniffs’ for attacks and mitigates them before they reach your browser.

All of this makes Cloudflare a real powerhouse at finding and stopping threats before anything even comes close to your website traffic, and if an attack does somehow get through, there are further tools to mitigate the attack.

Caching: Wait, there’s more?

Cloudflare CDN includes a caching mechanism that will only speed up your default Magento 2 caching setup. Cloudflare will cache absolutely everything that is cache-able on your site and distribute it to your visitors using their proxy servers. These servers are widely distributed ensuring a proxy server will be within range of your customers.

Let us know if any of these features sound attractive to you, and we would be happy to help you get Cloudflare integrated with your site. This is one of those ‘peace of mind’ decisions you will be happy you made.

Leave a Comment


Work With Us

We've been building websites for over twenty years, and have learned a thing or two about how to make web projects go smoothly.

What Our Clients Say

Watermelon Web Works, LLC place picture
4.7
Based on 19 reviews
powered by Google
OMS Anita profile picture
OMS Anita
22:20 29 Nov 24
Watermelon Web Works has been incredible to work with. They are patient, understanding, and quick to answer any questions (or emergencies) you might have. After switching over to them to help re-vamp our online retail store, we hired them to build our wholesale website as well. I can't recommend them enough - Thank you team!
Garrett Lister profile picture
Garrett Lister
19:55 10 Jul 24
Jared and the watermelon team were great - they quickly interpreted our website needs and designed a wonderful site. The project management site worked great to keep track of project.
N B profile picture
N B
21:23 14 Nov 23
My previous web developer who I was very happy with retired and I was pretty sad about it because it seems now days it is hard to hire a web developer close by with a good set of skills who is interested in helping small business at reasonable prices. Then I found Watermelon and I have been very happy. They are responsive, are able to solve problems, and work at reasonable prices.
Dark Star Magick profile picture
Dark Star Magick
18:05 03 May 23
We hired Watermelon to help us with our website. They were very thorough and took the time to explain in layman's terms what they were doing and how we could improve SEO and site functionality. We will definitely be back for future website needs!
Astoria Column profile picture
Astoria Column
18:42 24 Apr 23
Great work and amazing service! We're a non-profit, and our priorities are always focused on maintaining the Astoria Column. We had a website built by someone else a few years ago, but without regular updating and maintenance, sections of our site were no longer functional. Joanna and the rest of the team came in and had everything working within a week and it's been smooth sailing since then!
Ben Harris profile picture
Ben Harris
19:25 26 Aug 19
Watermelon has been a fantastic web development partner. Through every phase of our project they have always been 100% responsive to our requests and have always provided highly knowledgeable, creative, prompt, and personable team members to work with. As a financial institution we’re always concerned about the security and maintenance or our website and Watermelon has always provided the appropriate resources in order to meet and/or exceed our compliance and security requirements. We would surely refer them to any business associates looking for a qualified WordPress web designer in the future. – Denali Federal Credit Union
Mohr IP Law Attorneys profile picture
Mohr IP Law Attorneys
00:33 11 Apr 19
Watermelon Web Works did a great job creating a custom shopping cart page for our firm. Gavynn in particular was especially helpful and responsive. We appreciated the upfront costs and the technical competency of Watermelon Web Works and would not hesitate to work with the people there again.
Kim Markle profile picture
Kim Markle
23:36 08 Feb 19
Our company has been working with the Watermelon team for more than 10 years to help build and grow our website and customer portal. They are not only extremely talented and responsive, but are continuously looking for ways for us to enhance our current website. They are consistent, provide excellent customer service and really know what they are doing. Highly recommend!
Rick Brodner profile picture
Rick Brodner
23:23 12 May 17
I cannot say enough good things about Watermelon. They are terrific communicators, highly competent coders, and really, really nice people. They were instrumental in helping us to assemble a very usable, easily maintainable website for our organization. They' have demonstrated great flexibility in accommodating our evolving needs. They have been highly responsive to any technical issues, typically resolving them in less than 4 hours. Watermelon Web Works will make your organization better, and your CFO/Treasurer will be happy when they see the bill - what more can you ask for?
CLOSE