top | item 45559901

(no title)

matt_heimer | 4 months ago

Its not the the data is only cached by Cloudflare in one place, its that it is cached at the edge node nearest to the user that last made the request. Geographically different users will likely hit a completely different edge node that needs to hit your origin to populate its cache.

Cloudflare has a free tiered caching option that helped my site. Instead of cache missing on local edge nodes always having to hit the origin, the edge node can sometimes pull the data from another Cloudflare server. It reduced load on my origin.

Agree with needing to tune and validate caching, one of the biggest changes my PHP site was tuning apc/OPcache sizes.

discuss

order

r1ch|4 months ago

Cloudflare will actually slow down TTFB for small, less popular sites since they don't maintain a keepalive connection to the origin. This means you pay an additional TCP/TLS setup cost from the Cloudflare POP to the origin which is worse than a direct connection. I also tried testing a smart-placed worker and cloudflared, neither of which seemed to help.

matt_heimer|4 months ago

They can use keepalive but it's likely the small sites are not getting enough traffic on the edge nodes to maintain the connections.

You don't think taking a small hit on TTFB is a good trade off for the improved scaling that a CDN offers?

Gone are the days that you don't have to worry about bot traffic being a DDOS. An unresponsive site is a lot worse than an extra TCP/TLS setup.