Just set up my first CDN and my TTFB got worse?

LisaW_

New Member
Messages
53
Reaction score
0
Location
Edinburgh, UK

Not sure if I did something dumb here. Finally got around to putting Cloudflare in front of my site (small blog, like 40 posts, mostly images) and my TTFB actually went up in some regions. Was averaging maybe 400ms before, now I'm seeing 600-700ms on requests coming from the EU and Asia.

I followed some YouTube tutorial and set up a couple of page rules and cache rules but honestly I was kind of guessing my way through it. Did I break something with the caching level? Or is this just a cold cache thing that sorts itself out in a day or two?

For context I'm on shared hosting so the origin isn't exactly a rocket ship. Wondering if that's the actual problem and the CDN is just putting a nicer face on it. Anyone else go through this when they first set one up?

mike_t_2019

Member
Messages
60
Reaction score
0
Location
Leeds, UK

Cold cache is a thing but it doesn't explain 600-700ms. That's not cold, that's the CDN knocking on your origin's door and your shared host taking a coffee break before answering. Cache MISS from EU/Asia means Cloudflare flies to wherever your server actually sits, gets the slow response, and then serves it. First visitor eats that cost.

Which page rules did you set exactly? If you set cache level to "Bypass" or made a rule that excludes HTML from cache, every single request is a round trip to origin and you've basically paid for a middleman that adds latency. Check the CF-Cache-Status header on those slow requests. MISS on a static image = broken setup, HIT = fine. If your images are missing, it's probably a cache rule ordering thing, rules evaluate top down and the first match wins.

Tbh the shared hosting is your real ceiling though. A CDN hides a slow origin from people who hit cache, it doesn't fix one. I went down the edge rules rabbit hole on a different setup and it was the only thing that actually got me consistent cache hits instead of guessing

https://websiteforums.info/threads/bunnycdn-edge-rules-fixed-my-cache-headaches.47

And skip the APO upsell, overpriced for a blog with 40 posts

https://websiteforums.info/threads/cloudflare-apo-overhyped-for-non-wp-sites.4

Give it 24h before you panic though. Purge everything, then test from a EU looking glass and watch the header.

maria_lopez

New Member
Messages
66
Reaction score
0
Location
Miami, FL

Before anyone tells you to go buy edge rules, what are you actually measuring TTFB on? The HTML document, or an image?

Because if it's the HTML, Cloudflare's free plan does not cache HTML. Not with page rules, not with cache rules, not unless you're on APO and paying for it. So every HTML request from the EU still flies to your shared host and back. That 400ms baseline you were "averaging" before was already pretty rough, and putting a CDN in front of an uncached HTML request just adds a hop. You didn't break anything. You made a slow path slightly longer, which is why you're seeing 600-700ms instead of 400.

mike's right about checking CF-Cache-Status, but check it on an image, not the page itself. If your images come back HIT and your HTML comes back DYNAMIC or MISS, that's your whole story right there. Post the actual rule expression and the order they're listed in, rules evaluate top down and the first match wins, so a broad rule sitting above a specific one will eat your cache.

I burned a full weekend on this exact thing on a client's site before I realized the HTML was never being cached in the first place. Felt pretty dumb. What host are you on, and are you on free or Pro?

patrick_jones88

New Member
Messages
60
Reaction score
0
Location
Glasgow, UK

Maria's question about the host matters more than it looks, but I'd add one thing nobody's mentioned: how are you measuring that "before" 400ms? Because if the 400 was a single WebPageTest run from wherever, and the 600-700 is Cloudflare's analytics or a random uptime checker, you're comparing two different things. Shared hosts are notorious for TTFB that swings 200ms+ depending on time of day and how many neighbors are hammering the box. I've watched the same page on the same shared plan go from 300ms at 6am to 900ms at noon without touching a single config.

Also worth knowing: the first request from a new Cloudflare PoP is always slower, because that edge node has to do a full TLS handshake to your origin and pull the asset. That's per PoP, not per day. So your first EU visitor of the week eats the penalty and everyone after gets a HIT. With a 40-post blog you probably never build up enough volume to keep the cache warm, so you keep seeing "first hit per region" numbers over and over. That's normal and it's not a misconfiguration.

Which is also why I'd slow down before buying edge rules. If your images come back HIT and your HTML comes back DYNAMIC, the HTML is the bottleneck and no cache rule fixes that on free. What's your actual visitor geography? If it's 90% US readers, chasing EU TTFB is kind of a hobby, not a fix.

You must log in or register to reply here.