CloudFlare Optimization: Two Page Rules Every WordPress Website Needs
What is CloudFlare?
CloudFlare is not a standard CDN. It actually works as a reverse proxy. Meaning as opposed to a traditional proxy, which sits on the client side, and manages outbound traffic. CloudFlare's CDN sits server-side and manages incoming traffic from incoming users. The advantage to this method is, it allows it to manage all traffic before any of it hits your server. In addition, it allows them to become an effective web application firewall (WAF) and CDN at the same time. Page Rules are specific rules that control how CloudFlare treats certain pages. For example, you can turn the security mode higher for login and register pages. Or you can disable certain optimization features on pages where it has been found to break them. More importantly, though page rules give you access to features in CloudFlare that are not found in other sections of the panel. In fact, I use Page Rules on almost every site to increase the hit rate of my cache to reduce server load. In addition, it reduces bandwidth and improves the load time for my users. If you are on WordPress you might have seen some articles recommending to add the "cache everything rule". This rule will tell CloudFlare to cache everything including HTML files which is where problems start to arise if you use Page Caching. However, you can take the concept of this rule set and another rule to cache all static resources. For instance, if you have a gaming website your Flash files or Unity files are not cached by default. This rule set will cache them to reduce your server load. In addition, if you are serving videos (even if its just a header video), this will apply to that content as well.Setting Up Page Rules on your WordPress Website
To get started follow the following steps.- Go to your CloudFlare admin panel.
- Click on the "page rules" option.
- Click on "create a page rule".
- Set the domain to as follows: *yourwebsite.com/wp-content* In our case, it reads like this *sertmedia.com/wp-content*
- Go down to the settings. Set the rule Cache Level: Cache Everything.
- *yourwebsite.com* In our case it reads *sertmedia.com* (it might change it to have a trailing slash which is ok as well).
- Go to Edge Cache TLL: "A Month".
Scott Hartley
Founder & CEO, Sert Media
Founder and CEO of Sert Media, a Nashville-based digital marketing agency. Scott has spent over 15 years helping businesses grow through SEO, web performance optimization, and strategic digital marketing. His deep expertise in WordPress development, site speed, and technical SEO has guided hundreds of brands toward measurable results. When he's not auditing Core Web Vitals or refining campaign strategies, he's writing about the tools, techniques, and trends shaping the modern web.
Related Articles
How to Add Security Headers to WordPress Using Cloudflare Transform Rules
If you've ever run your WordPress site through securityheaders.com and gotten a D or F…
Use This Cloudflare Rule To Reduce Plugin Hack Attempts
Cloudflare Firewall Rules give you a lot of flexibility in further protecting your website. Here…
Set Up Cloudflare's Automatic Platform Optimization Feature
Automatic Platform Optimization (APO) is a new feature from Cloudflare that allows you to cache…