Let me add my own request to Scott’s, five months later!
In my case, besides having exactly the problem described, things are a bit more sneaky. Although I have done experiments on a “fresh install” of Super Page Cache, the results were more confusing than enlightening.
I generated a new API key for the new website, and added all Edit permissions I could toggle (a few are read-only) — which took me 15 minutes or more (!). Then I connected to Cloudflare from the SPC plugin. OK, that worked fine. Next step: testing the connection. All failed — both for Cloudflare and the local Page Cache (!!). But it still showed Cloudflare as being “connected” — just not enabled (the plugin comes with disabled as default).
So — I clicked on enable!
As reported, that gives the usual 10000 or 9901 codes. Testing the connection again from the plugin, I get precisely the same result.
However… the “enabled” button… stayed on!
Now, that was a first. Usually, as soon as the plugin detects that something is wrong, it (correctly) returns to the disabled status. This didn’t happen this time!
I proceeded to investigate further. Using now curl from the command line, I investigated the headers. The first request (as expected) returned a MISS from both Cloudflare and the Page Cache. However, after 2-3 tries, both Cloudflare and the Page Cache (!) included their headers with a HIT! (Note: there is one header placed by Cloudflare; another by the SPC plugin; both have returned a HIT.)
Returning to the SPC plugin’s dashboard, I tried to do a new test. Once again, it failed for both Cloudflare and the Page Cache — but, for some reason, it stayed enabled. Good for me, because now I could test with other pages, images being served or JS/CSS, etc. All of these worked and were being cached — according to the headers.
I’m going to replicate this on a test site I’ve got, starting from scratch, and which I can give you all access to do your own testing. Let’s just see if I can replicate the same experience. Note that this only happened with a site that never used SPC before, and with a new key. All other sites with an existing SPC installation, even with a new, more permissive API key, continue to exhibit the problem here as initially reported.
Also note that even the fresh, clean, brand new installation did give the same errors as all the other sites. The difference is that it kept the connection to Cloudflare enabled, and, incidentally, the Page Cache seems to be happy as well.
I wonder if this has something to do with my recent upgrade to PHP 8.4 under nginx. That was perhaps the most important change that I made on that bare metal server, which is fully managed by me, and so there cannot be any “surprises” in it which haven’t been installed by myself 🙂 That’s the only way I have to know that the actual infrastructure stack is not interfering with anything…