Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

Very low TTFB with WordPress #39

Closed
gijo-varghese opened this issue Jun 19, 2019 · 18 comments
Closed

Very low TTFB with WordPress #39

gijo-varghese opened this issue Jun 19, 2019 · 18 comments

Comments

@gijo-varghese
Copy link

gijo-varghese commented Jun 19, 2019

I've implemented as per the docs in the demo site https://gijovarghese.com. However, there is no much difference in TTFB

On testing, most of the locations have a TTFB of greater than 500ms. I tested it via https://tools.keycdn.com/performance?url=https://gijovarghese.com/. I tested multiple times so that it would cache in all servers

However, TTFB of another WP site which implemented page rules to cache everything have a TTFB <100ms in all around the world. See https://tools.keycdn.com/performance?url=https://coffeencoding.com/

What could be the reason?

Note: I've removed the part that checks for 'no-cache' header since most these tools send no-cache header

@michaelbourne
Copy link

I've noticed the same thing on the KeyCDN tools performance tester. "Cache Everything" page rule gives me insanely fast TTFB times on that test, but the workers cache setup does not. Inspecting the headers whos me there are no edge-cache headers coming from CF on the requests.

However, if I VPN into different countries and test the site with the workers setup, the proper edge-cache headers are present and the TTFB is great.

With that, I assume the KeyCDN test is bypassing the workers script somehow, but real world tests show it works.

@gijo-varghese
Copy link
Author

@michaelbourne yeah, I noticed it too. Headers are not shown. But there is no way fo KeyCDN to detect whether it's coming from the worker or not right? @pmeenan any thoughts on this?

@shagamemnon
Copy link
Contributor

@gijo-varghese — can you provide the Worker code you’re using?

@gijo-varghese
Copy link
Author

gijo-varghese commented Jun 25, 2019

@gijo-varghese
Copy link
Author

@shagamemnon any updates?

@gijo-varghese
Copy link
Author

@michaelbourne how much TTFB are you getting? When I tested it with GTmetrix, it's still around 200-300ms, with cache hit

@michaelbourne
Copy link

My best was around 115ms, worst 300ms. I've never seen it under 100ms with CloudFlare, in any setup. ~100ms is a fair trade off to me for the additional benefits they offload from my server though.

@gijo-varghese
Copy link
Author

yes, <100ms is more than enough. Even the cache everything rule gives <60ms in most of the locations (https://tools.keycdn.com/performance?url=https://coffeencoding.com/). Don't know what's wrong with service workers

@wpsumo
Copy link

wpsumo commented Oct 30, 2019

@gijo-varghese Still seeing the same TTFB or have you switched on ARGO for lower TTFB?

@gijo-varghese
Copy link
Author

@alriksson I've turned off Cloudflare for now

@wpsumo
Copy link

wpsumo commented Oct 30, 2019

@gijo-varghese I see, may I ask Why? or just temporary dev mode?

@gijo-varghese
Copy link
Author

@alriksson CF is lowering my TTFB. It's better to directly connect to the server

@wpsumo
Copy link

wpsumo commented Oct 30, 2019

Okay, but it should be faster to connect to your server through CF with ARGO or when HTML is cached in the edge?

@gijo-varghese
Copy link
Author

@alriksson Argo costs money, and I'm not willing to pay that for now. Also, there are a lot of troubles occurring when I cache HTML

@wpsumo
Copy link

wpsumo commented Oct 30, 2019

I see, haven't experienced that much of troubles with cache HTML but do not have any memberships or transactional website so.

Thanks for sharing :)

@gijo-varghese
Copy link
Author

@alriksson I've explained a few issues with WP here: https://wpspeedmatters.com/caching-html-pages-at-the-edge-using-cloudflare/

@wpsumo
Copy link

wpsumo commented Oct 30, 2019

@gijo-varghese Yes correct! :)

But I understand it can cause issues depending on the need and sites, but then ARGO is an alternative for the one who want to pay. But the calculation of use is a bit off to pay all traffic not only the one fetched from the origin.

Did you use the free workers or the KV? Since KV do not flush the whole instance as long as you don't manually trigger the purge. KV is of course paid which wasn't what you were looking for.

I haven't tried ARGO myself to see the reduce in TTFB 35% is what they marketing it as.

@lauragift21
Copy link
Collaborator

This repo has been moved over to the workers-sdk monorepo located here: https://github.com/cloudflare/workers-sdk/tree/main/templates

If you still have further issues about this, feel free to create an issue there. I will be closing this out for now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants