Cf apo + sg optimizer + wp-rocket

Hello wanted to reply to this closed topic: APO Compatibility with Siteground shared hosting

CF is recommending with APO, to disable SG Optimizer (and other caching plugins such as WP-Rocket I suppose)

Are we sure here that this is going to give better perf? Both are rather powerful plugins with dynamic and memcache (for SG) as well as other great speed optimization features.

Will APO be faster than this? And does it has to be disabled when used together? Sorry just rather skeptical here…

Hey @henaff.kevin,

We’re planning on doing some targeted research and comparison against the other leading WP cache / performance related plugins soon, which should definitively answer this question.

APO in theory should out perform existing solutions because of our extensive edge network we use to cache the content. If you’re just using a caching plugin without a CDN, all traffic going to your site would still have to make round trips to and from your origin server. With APO, we serve that content directly from the edge - closest to your users. We also bundle this with caching Google fonts, asset minification, and other features that come for free with Cloudflare.

In any case, it’s probably best to run some tests of your own to confirm that APO is outperforming your current set up to be sure. Every WP site is unique in it’s own way, so it’s difficult for us to make blanket statements.


Hi pjohnson, thank you for your reply!

So far Cloudflare + WP-Rocket + SG Optimizer gives great performances on our end

I assume it depends on your host resources too and it might outperform origin performances on smaller shared servers with less computing power?

Curious and will give it a try it does sound very appealing and easy to integrate

Would be great if disabling other cache plugins isn’t mandatory though. So far WP-Rocket and/or SG Optimizer as far as we’re concern have always integrated seamlessly with CF (would be great if Siteground could support CF Argo but that’s another topic).

If I may ask a few final questions for which after a lot of reading haven’t found answers to:

Does APO only give an edge for 1st load, non-logged in users like CF HTML edge cache worker does?

Any particular settings to modify (such as page rules?)

So far it only offloads HTML and some public scripts from onto your network right? Such as Google fonts?

Many thanks for your confirmation!

1 Like

Your host resources would only come into play in the event the cache misses (ie we serve a page directly from your server vs our cache). Ideally, we’re serving as much content from the edge (cached content) vs from your server.

I would say there is probably a lot of duplicated functionality across WP Rocket, SG Optimizer, and APO. Using APO without the others may even perform better than using a combination of a the three. APO + Argo would almost certainly perform better.

Does APO only give an edge for 1st load, non-logged in users like CF HTML edge cache worker does?

  • Yes - as long as the same version of that page has been requested before (by anyone or anything) it will be served upon the first hit.

Any particular settings to modify (such as page rules?)

  • Page views are not required with APO. The optimal settings are automatically configured for you on the backend.

So far it only offloads HTML and some public scripts from onto your network right? Such as Google fonts?

  • No, it will cache all static assets as well as the content of each page that’s not dynamic (ie change based on logged in user). This includes images, JS, CSS, HTML, etc…

I’d read our blog on APO if you haven’t already as it explains in depth how it all works: Introducing Automatic Platform Optimization, starting with WordPress

We also have a fantastic knowledge base that we update periodically that answers a ton of FAQs:


Hey pjohnson,

So in theory we could use a very low-end shared hosting server. Then upgrade with APO and Argo? And see better results than I higher-end VPS with Cloudflare?

1 Like

Depends on the traffic. Cloudflare APO won’t cache all query string requests - only some. So CF APO on query string cache miss, will hit your origin. In which case how performant your origin server is will come into play.

Also any requests that don’t have Accept text/html or GET requests will still hit the origin with CF APO.

Yup, though CF APO vs CF Worker caching is very close. I did benchmarks below comparing my CF Worker custom Wordpress caching versus CF APO cache. Difference is with my own, I also have a 2nd level origin cache to smooth out CF cache misses and to handle query string cache misses. My 2nd level origin cache alone without CF caching can handle up to 1,000 to 5,000 concurrent users on a 1 cpu KVM VPS $5/month server thus smoothing out any CF cache misses that do hit my origin. So that is where a 2nd level caching plugin on origin MAY help

Can you tell me your config? Are you using Cloudflare’s official plugin for APO or do you have a custom rues setup? That would really help me setup edge caching. I have tested many sites and only yours return proper headers for cf-cache-status hit. I tested the two links you shared.

I am using Cloudflare official Wordpress plugin with APO disabled and pairing it with my own custom CF Worker caching which I also use on my Xenforo forums.

Wordpress is setup using my own developed Centmin Mod LEMP stack Wordpress installer outlined at with PHP-FPM fastcgi_cache full HTML caching on origin served via Nginx. But you can also use full HTML caching on origin via Wordpress Cache Enabler plugin with advanced Nginx level cache offload Either method can be paired with Cloudflare’s official Wordpress plugin with APO disabled and just use plugin for Cloudflare cache purge/invalidation.

Cache Enabler with my Nginx advance cache configuration (not available in plugin out of box and needs origin end config) will end up being faster than PHP-FPM fastcgi_cache though due to Cache Enabler pre-gzip and/or pre-brotli compressing the full HTML cached files and with Nginx gzip_static/brotli_static enabled directives will allow Nginx to serve the pre-gzip/brotli compressed cached files instead of using on the fly compression which can improve request throughput by up to 3x times and response latency by 60% GitHub - centminmod/autoptimize-gzip: Autoptimize Gzip Wordpress Plugin hooks into Autoptimize API to enable pre-gzip compression of Autoptimize'd CSS & JS files !

I also use Autoptimize with my companion Autoptimize Gzip plugin to do the same thing allow Nginx via gzip_static directive to serve pre-compressed css/js files and eliminating the need to use on the fly gzip/brotli compression which is much slower than pre-compressed gzip/brotli compressed file serving GitHub - centminmod/autoptimize-gzip: Autoptimize Gzip Wordpress Plugin hooks into Autoptimize API to enable pre-gzip compression of Autoptimize'd CSS & JS files

Though in context of CF proxied connection, such pre-compressed benefits are for connection between CF edge server and origin.

Once CF APO matures, I am hoping it will work well with my existing configs on origin side too :slight_smile:

To fully optimise you need to optimize 3 segments.

  1. segment 1 - connection between visitor and CF edge server i.e. CDN cache, WAF, Firewall, Page Rules, Mirage, Polish webP, HTTP/2, HTTP/3, CF Workers (i.e. custom/advanced caching) etc
  2. segment 2 - connection between CF edge server and your origin i.e. Argo, Railgun & Full SSL/ECDSA SSL certificates, pre-compressed asset served from origin
  3. segment 3 - your origin server’s performance/optimisations i.e. web server, PHP, MySQL server optimisations and server hardware specs.

Cloudflare can only help for segments 1 & 2 for cached guest/non-logged based visitors will easily scale. Now for Cloudflare CDN cache miss/bypass and logged in user for web apps like forums/wordpress, performance will be determined by segment 3.

1 Like

Thank you pjohnson for your reply!

Will give it a try, but for ex at the moment if I do not use WP-Rocket’s RocketCDN (Stackpath) and only rely on CF, pictures visually take longer to load (you can tell when the page is loading)

Additionally, the number of pages in Google Search Console Core Web Vitals, with poor LCP on both mobile and laptop (above 4sec) goes up big time. Just tried turning RocketCDN off for a few days to monitor the difference (as search console results are delayed)

So that alone really has me doubting that performances are going to get better with APO while excluding my current setup. Guess it makes sense on shared hosting with low resources and/or smaller mostly static websites but most likely won’t on dynamic ones.

That’s a lot of work. But damn, the speed is amazing when I check your forums. Is hope there was a simpler way. I am on a Managed WordPress hosting, so I guess cetimod won’t work as my site is not on VPS.


Hey so I did a quick scan of all of the responses and I don’t think anyone really hit on the remaining why you need to use something like WP Rocket besides just APO.

While APO now replaces most of what WP Rocket does, we still need to use it for lazy loading images. WP Rocket just implements this lazy load so it should be rather easy to make the plugin completely redundant - GitHub - verlok/vanilla-lazyload: LazyLoad is a lightweight, flexible script that speeds up your website by deferring the loading of your below-the-fold images, backgrounds, videos, iframes and scripts to when they will enter the viewport. Written in plain "vanilla" JavaScript, it leverages IntersectionObserver, supports responsive images and enables native lazy loading..

WP Rocket also has a DNS pre-fetch which is nice.