Cloudflare APO or Automatic Platform Optimization

Advertisement

Today I am going to be talking about the Cloudflare APO or Automatic Platform Optimization. I’m going to be going over what it is. I’m also going to be talking about how it impacts, if you’re already using a caching solution and I’ll show you how to set it up for your own website. Now keep in mind for those of you on the free plan, this is a 20 dollars a month cost that you will have to pay for. If you’re on the Pro plan or higher, this will automatically be included, but I’ll tell you how to set it up and it’s the same process either way. So let’s just go ahead and jump right into it.

The APO has two benefits, but really only one of them matters. It has edge HTML caching which means it’ll copy your website’s HTML and serve it from Cloudflare edge. Previously, unless you were trying to use workers or you were trying to use the page rule system it, it caused a lot of issues, If you were logged into your website, what would happen is you would just not get your admin toolbar. You wouldn’t be able to use Element or or really anything that could identify you as being logged in because there was no way to ignore cookies. The only way to ignore cookies previously required the business-level plan or higher which was 200$ a month. That’s completely absurd. The benefits to caching your HTML, other than reducing your TTFB and improving the overall performance is if you have users from different countries. They now get served a much faster experience.

So, for instance, I ran GTmetrix. I don’t care about the fully loaded time, about any of those details right now.  I ran this from the Dallas server here. It was 168.4 milliseconds. That’s a really good fast server response time. It is served from varnish cache and there’s a page cache through WordPress Rocket as the fallback for this particular website. Then I tested this location from Australia and it was 222 milliseconds. Not that slow, but again, this depends very much on where your server is and the speed of your server. And then I also tested one from china and that was 362 milliseconds. the benefits to using the APO is all these users should have relatively the same response time because they will be getting served cached versions from the location closest to them. So I’m going to go ahead and show you how to set this up. There are technically two ways to set this up you can use the setup where you don’t install the Cloudflare plugin or you can install the Cloudflare plugin and I recommend in this case using Cloudflare’s plugin.

The documentation is pretty straightforward. The biggest reason that you want to use it with the Cloudflare plugin really comes down to not so much this nonsense but It will decrease the amount of work that your origin server has if you have the WordPress plugin installed. It basically never needs to touch your server unless the Cloud flare plugin on your server says “Hey the cache needs to be purged. Something was updated” and there is automatic cache management. for those of you who were using something like WordPress rocket or Swift where you had built-in automatic cache management and it could clear the Cloud flare cache you’re going to need to disable those add-ons to get the most out of this because they’re not set up yet to really work with APO. So it’s going to run into a bit of an issue and just to get the full effect of it because it is five dollars a month. If you’re using the free plan, you’re gonna want to get the most for it and to reduce your server load. now this will work with WoCommerce, but keep in mind not every plugin will work with this. It’s a fairly new system. If you notice you have a plugin and the cookies are not being ignored when they should be, you can go over to the community forums and suggest it. Cloudflare and their development team have been super responsive at adding them. There’s virtually no settings in here. You cannot exclude cookies on your own. It’s completely automatic.

So, let’s jump in and go through the setup real quick. So you got to find your domain obviously and you have to pay for it there’ll be a purchase button here just go ahead put in your credit card information whatever you use and pay for it then it wants you to install their WordPress plugin and we’re going to do that real quick. So we’re just going to install Cloud flare and click activate. This has been updated fairly recently. We’re going to be using the latest version. So then you’re going to go to the settings and you’re going to go to Cloudflare. You are going to need the all-important API key. So just stick your email address in there.  And you’re just going to copy that nice API key and you’re going to hit the save button. It’s going to go ahead and do the background work to make sure hey this is actually for your website. It’s going to match the Zone ID and then it’s going to go ahead and give you the nice Cloudflare screen. Now in here, you can now activate the automatic platform optimization. once you do so, it should reflect in your Cloudflare panel and it does. The WordPress plugin has now been successfully detected for Daily Driver Tips.

One other thing, I recommend doing is going over and then you can enable auto-purge content on updates. I highly recommend enabling this option. just go ahead and enable it and the reason you’re going to want this is because otherwise what you’re going to have happen, is if you don’t auto purge content, so you publish a new post or you update a post, it will not clear from cache right away. So there will be a bit of a delay by purging only the post that is necessary and this will do the logic for it it’s going to reduce cache misses which is when the cache is not when the website or the page in this case is not stored in cache and the server has to then send a copy to Cloudflare for them to cache this will just make sure only the most important pages the post of yourself that you’re updating, your blog page, your category if you use categories, and your home page get updated. The good news is those all tend to be pages that get hit quite often. Once that’s done .

Another note I want to point out is if you use Pingdom. Pingdom will not pick up on this. It’s for some reason automatically bypassed by the way they run the test. So real quick, we can tell that the Cloudflare cache status was a hit. So it only reduced it by about 20 milliseconds and i have a very fast server in a Dallas data center and my account and my response time was still reduced. That’s a good win in my book. I honestly can’t really complain about that kind of result. Now we’re going to look at our global results. So we’re going to go ahead and test it from the China location again. So that’s still a good thing and the other benefit is because it’s on Cloudflare’s edge, it reduces the load to your server virtually to zero. If you find that during heavy times your blog or your news magazine website, whatever it may be, and your servers getting hit very hard after you publish a new story, this will greatly reduce the impact to your server, so long as you don’t need to ignore, you don’t need to ignore any important cookies that are automatically added and this will increase your cache hit status to Cloudflare from the sites that I have deployed this on to around i get normally 60.

On Daily Driver Tips for reference I’ve been seeing 90 plus percent, depending on the type of website and audience. So we’re going to go ahead and look at this Hong Kong location and we’re just going to see this is probably a cache miss. So this was a cache hit, but the response time from GTmetrix looks to have been pretty bad.We’re just going to give it another run through. It wouldn’t ever make sense for this to result in a lower response time solely because the distance between the two servers is physically reduced and the Sydney location is going to be backed up for a while. There is another benefit to this and it optimizes the Google Fonts. I’m actually not a really big fan of that. What it does is it’ll take Google Fonts and inline the styling for them and my problem with that, see that’s a much better 200 milliseconds, when it was originally 362 milliseconds. For the exact same package before the APO and this applies to virtually any location. All kinds of countries if you have your server say in Singapore and you have an Australian audience which is common with Site ground customers this would greatly reduce your response time to them as well and I’m overall just really pleased with the system they have added, but I kind of feel like this is very much what their old worker’s scripts were, but it just takes that work out of it.

It’s not bad by any means though when you’re reducing your response time to international audiences. There’s not really a lot of good ways to do so if you were trying to use workers then you obviously to worry about paying for your worker scripts, which could be quite expensive depending on how many you had and how many websites you were running and the amount of audiences that were using them you could have used the old page rule method which I pretty much determined to not be really worth your time unless you’re on the business plan because it would cause more headaches than it solved. And wow 187 milliseconds. That’s pretty identical to what you’re seeing in the Texas server where my actual server is located and you know we got this one which is still taking forever.Which is quite common when you’re testing from the Australian server on GTmetrix. I don’t know why that server is always hammered, but we’re seeing great reduction and I virtually eliminated the load from my server I’m very pleased with APO’s. Just keep in mind that the five dollars a month is per site. If you own many small websites that don’t get a lot of traffic, it can be quite expensive. Also and this is very important, this is not a replacement for having good web hosting. I feel like users use Cloudflare and stuff to kind of mask a bigger issue of the web hosting not being good. So if you’re on GoDaddy Business Hosting, which is basically just glorified shared hosting on their platform and your response time is terrible. This is not going to really fix your problem completely.

At the end of the day, if you’re getting terrible response times, if somebody misses the cache in Cloudflare which can happen especially if you update a lot or you’re using something like WooCommerce and they have to bypass it to check out, you’re going to get hit with some really slow response times. Still this will reduce the load on the server, but it’s not a perfect fix. So if you’re using a good host like Kinsta, WP Engine or Siteground or Cloudways,you’re still going to benefit from those platforms. Don’t think that you can now substitute bad hosting with the APO. This is just a good compliment to reduce the load on the server and to reduce the response time for the users when it can and there are a lot of times when it can’t. During checkout, any time a cookie is placed, when comments are added on WordPress posts because there’s a cookie to bypass it to show users that their comment’s been published, or that it’s moderating things of that nature. You are going to easily get it bypassed. Even if you rely on PHP sessions for some strange reason. None of this is really going to help you because then any functionality behind the PHP session will just not work if you use this on your website. Please just share your results in the comments, it’s honestly a great five bucks a month for it. Especially if you have an international audience. Just be careful and don’t buy cheap hosting because you now have an APO to reduce your response time. It’s not going to fix all of your issues. We’re going to double-check. Alright. So let’s see what this Sydney response time was. Maybe it wasn’t even cached. Okay so 194 milliseconds and our before was 222. I’m gonna count that as a win. Uh. Even though it probably. No it did result in a hit, which is awesome and it’s just gonna keep a very consistent and low response time.

Alright and that was everything you need to know about the Cloudflare Automatic Platform Optimization (APO) for WordPress. It’s honestly a very simple and yet very useful bit of tech. It works off their worker’s platform and it’s very easy to get very strong improvement on your WordPress websites, even those of you on e-commerce websites like WooCommerce. You can still see very noticeable gains just by enabling it for the non, for the users who don’t buy anything, either abandon the page, or just don’t check out. If you have any questions about it or whether you feel it’s needed for your own website, you can ask in the comments below. Also make sure to check out our new Facebook group! You can go ahead and join it. I’ll put a link in the description and that just allows us to ask questions a bit more in the community type fashion that way it’s not just me trying to respond to every YouTube comment. As always, if you have any questions though, please feel free to ask. Thank you so much for watching and goodbye.

Advertisement