Git Product home page Git Product logo

Comments (18)

michaelbourne avatar michaelbourne commented on June 28, 2024

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.

from templates.

gijo-varghese avatar gijo-varghese commented on June 28, 2024

@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?

from templates.

shagamemnon avatar shagamemnon commented on June 28, 2024

@gijo-varghese β€” can you provide the Worker code you’re using?

from templates.

gijo-varghese avatar gijo-varghese commented on June 28, 2024

@shagamemnon it's mostly the same as in https://github.com/cloudflare/worker-examples/blob/master/examples/edge-cache-html/edge-cache-html.js

But I've disabled the lines from https://github.com/cloudflare/worker-examples/blob/8affa71e494e43a2d2c2c106a9ad03f84472cc42/examples/edge-cache-html/edge-cache-html.js#L171 because KeyCDN and similar tools send a 'no-cache' headers

from templates.

gijo-varghese avatar gijo-varghese commented on June 28, 2024

@shagamemnon any updates?

from templates.

gijo-varghese avatar gijo-varghese commented on June 28, 2024

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

from templates.

michaelbourne avatar michaelbourne commented on June 28, 2024

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.

from templates.

gijo-varghese avatar gijo-varghese commented on June 28, 2024

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

from templates.

wpsumo avatar wpsumo commented on June 28, 2024

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

from templates.

gijo-varghese avatar gijo-varghese commented on June 28, 2024

@alriksson I've turned off Cloudflare for now

from templates.

wpsumo avatar wpsumo commented on June 28, 2024

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

from templates.

gijo-varghese avatar gijo-varghese commented on June 28, 2024

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

from templates.

wpsumo avatar wpsumo commented on June 28, 2024

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

from templates.

gijo-varghese avatar gijo-varghese commented on June 28, 2024

@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

from templates.

wpsumo avatar wpsumo commented on June 28, 2024

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 :)

from templates.

gijo-varghese avatar gijo-varghese commented on June 28, 2024

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

from templates.

wpsumo avatar wpsumo commented on June 28, 2024

@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.

from templates.

lauragift21 avatar lauragift21 commented on June 28, 2024

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.

from templates.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.