My Scraper's Success Rate Was the Target's CDN Cache Answering for It

November 30, 2026

Support me on Patreon to write more tutorials like this!

profile picture
Tony Wang

One of the routes I run fetches search results from a luxury fashion retailer. The site sits behind Cloudflare's CDN and DataDome's bot protection, so a plain HTTP client gets a 403 and the route uses a fleet of browser backends to render the page. That makes it the most expensive route in its family. I wanted to know whether any cheaper path would work, so I pointed a probe at the retailer's search JSON endpoint and tried every client profile I have.

79 of 168 attempts passed. That looked like a cheap path worth building.

It wasn't. 78 of the 79 passing responses carried cf-cache-status: HIT, and all 79 bodies were byte-identical (same sha256). One request had gone through to the origin. After that, Cloudflare's edge served its cached copy to everyone who asked for the same URL, including clients the origin would have blocked. The real success rate was 1 in 168.

I'm leaving out the retailer's name and anything about how the backends work. This post is about measurement.

The short version

  • A bot-protected site can still serve cached pages to a blocked client. On a CDN-fronted target, "N of M requests succeeded" mixes up "my client got through" with "someone already asked for this URL".
  • One random query parameter makes a URL the cache has never seen. In the same path, same term, about a minute apart, 17 of 25 backends passed the warm URL and 0 of 25 passed the busted one.
  • A positive control on an ordinary site ruled out a broken fleet: wikipedia.org passed 17 of 25, the same count as the warm page.
  • The route's uptime monitor queried a term that is always warm, so it measured the retailer's cache and not my route.
  • I already knew about this trap. I had written it down in September, and it caught me again anyway.

What a cache hit looks like from the crawler's side

From the client's side, a CDN cache hit is a 200 with the right content. It passes every success check I had: status code, success markers in the body, no challenge page. The only signs are a response header I wasn't checking and a body that is identical across requests that should differ in small ways.

So I added controls. I sent the same request with a unique nonce parameter, which the edge can't have cached. It failed on every profile, 0 of 9. The same nonce on a category request also failed, 0 of 6.

On the live route the pattern was there all along. Of eight arbitrary search terms, four came back in 1.5 to 4.2 seconds and four came back as 503s after about 30.5 seconds. The fast four were terms someone had already searched for. Pagination showed it most clearly: page 1 of a common term returned 200 in 3.0 seconds, and page 2 returned a 503 after 30.9 seconds, because nobody had asked for page 2 recently.

Testing the render fleet itself

The JSON endpoint was never the production path, so the next question was whether the render fleet (the thing customers actually depend on) had the same problem. I ran the full matrix of 25 backends against the retailer's HTML pages, one probe every couple of minutes, for about half an hour:

Time (UTC)PagePassedBlocked
09:41search, common term170
09:43search, second common term170
09:45same as 09:43, plus one random parameter017
09:47search, a term nobody had used017
09:50category page016
09:52home page016
09:58search, ordinary term016
10:02same as 09:43, again170
10:04product page016

The pair to look at is 09:43 and 09:45: same path, same term, same 25 backends, a minute apart. The only difference was one query parameter the site doesn't recognize, and the result went from 17 to 0. The failures weren't timeouts. 16 or 17 backends in every cold run got an explicit DataDome challenge, and the rest failed for transport reasons. It also went back the other way: the 09:43 URL passed again at 10:02.

On the warm runs, the plain-HTTP profiles passed in under a second with a cache-hit header. Some browser backends "passed" in 0.1 to 0.2 seconds. A real render of this site takes several seconds, so those were cache hits too.

The control that ruled out a broken fleet

A row of zeros has two explanations. Either the target refuses cold requests, or my fleet is broken and the warm passes are only cache. To tell them apart I ran the same 25-backend matrix against wikipedia.org. It passed 17 of 25, the same count and the same mix of profiles as the warm retailer page.

So the fleet was healthy. The retailer was refusing every cold request on every backend, and the only thing that moved the result was whether the URL was already cached at the retailer's edge.

What the monitor was measuring

The route's uptime monitor runs every two hours with a fixed search term. That term has been in the monitor config since the route launched on 2026-09-08, and its URL is permanently cached at the retailer's edge. A second route in the same family monitors a fixed category that is always cached in the same way.

So the monitors reported up whenever the retailer's cache was warm. They couldn't see that an arbitrary customer query, or page 2 of any query, was failing. I wrote about a version of this before: my canary only fed the worker targets that would succeed. That one picked easy inputs by accident. This one picked an input that someone else's traffic keeps answering for me.

The timeout I nearly blamed

Before any of this, I had a different explanation for the 30-second 503s. The route inherited a 30-second deadline from a shared policy, and that is shorter than the render fleet's own 75-second budget. So I assumed slow renders were being cut off, and I merged a 90-second deadline.

That is a real mismatch and the fix is still correct, but it doesn't help here. The cold runs weren't slow. They were refused, with a challenge page, on every backend. Giving a refused request more time just makes the 503 slower. (Failed calls aren't billed, so customers paid nothing for these. They just didn't get results.)

I already knew this

The part that bothers me most is that none of it was new. When I first researched this site, on 2026-09-08, I wrote: "a Cloudflare edge-cache HIT returns 200 to a blocked client, so a bare pass rate is meaningless." I used a control then. I checked that each URL returned 403 to a plain client, ran the fleet at it, and checked again afterwards. With that control, the fleet recovered 4 of 4 cold category pages and 2 of 4 cold product pages.

The control also showed how the trap works. For every URL the fleet recovered, the re-check with the plain client that had been refused returned a 200. The likeliest reading is that my own render warmed the cache, and the plain client was then served the cached copy.

So in September I had the rule and the control. I still wrote monitors with fixed, popular inputs, and in November I still read a raw 79-of-168 as a pass rate before I checked the cache header. Writing a rule down in one note doesn't make me apply it in the next probe or the next config file.

What I'd do differently

None of these is in place yet. They're what the two notes add up to.

  • Every success-rate probe against a CDN-fronted target should get a cache-busted twin. If the busted version doesn't pass, the plain version's pass rate doesn't count. The probe should also record cf-cache-status (or the CDN's equivalent) per attempt and flag a body that is identical across every attempt.
  • Monitors should use a cold input. A rotating term or a nonce parameter, so that "up" means the route did the work. A fixed popular query on a cached site measures the site's cache.
  • "More time" is only a fix for slowness. Before raising a deadline, check whether the failures are slow successes or fast refusals.
  • Positive controls on an ordinary site. Before I read a column of zeros as "the target refuses us", check the same matrix against a site that should pass.

What I don't know

  • When the fleet stopped clearing cold pages. In September it did; on 2026-11-27 it didn't. The warm monitors were the only thing watching, and they couldn't have seen the change. Each cold page type was sampled once, so I don't yet know whether this is a temporary tightening on the site's side or a permanent change.
  • Whether the cache explains all of it. On the warm runs, some browser backends took several seconds and returned slightly different body sizes, which looks like real renders that succeeded. A warm URL might also change how the bot check treats a request, rather than the cache simply answering. I haven't separated the two.
  • Whether my other browser-rendered routes have the same blind spot. Any route whose monitor queries a fixed, popular input on a CDN-fronted site could. I haven't audited them yet.