Comments (18)
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.
@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.
@gijo-varghese β can you provide the Worker code youβre using?
from templates.
@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.
@shagamemnon any updates?
from templates.
@michaelbourne how much TTFB are you getting? When I tested it with GTmetrix, it's still around 200-300ms, with cache hit
from templates.
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.
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.
@gijo-varghese Still seeing the same TTFB or have you switched on ARGO for lower TTFB?
from templates.
@alriksson I've turned off Cloudflare for now
from templates.
@gijo-varghese I see, may I ask Why? or just temporary dev mode?
from templates.
@alriksson CF is lowering my TTFB. It's better to directly connect to the server
from templates.
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.
@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.
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.
@alriksson I've explained a few issues with WP here: https://wpspeedmatters.com/caching-html-pages-at-the-edge-using-cloudflare/
from templates.
@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.
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)
- In worker-rust template update `worker` dependency to 0.0.11 HOT 1
- WHIP and WHEP templates are not properly working in Firefox
- worker-rust build command does not work HOT 2
- worker-mysql build fail
- worker-mysql does not work well MySQL-compatible database HOT 1
- Typo in "about" section
- Error: EXDEV: cross-device link not permitted HOT 2
- Ship a prettier/editorconfig with every template
- Uncaught ReferenceError: jQuery is not defined HOT 12
- POST /wp-admin/admin-ajax.php 403 (Forbidden) HOT 2
- Wordpress multisite HOT 1
- "Routes" missing from workers? HOT 1
- Unable to bypass at all. Documentation missing page rules.
- Worker routing problem on react app HOT 2
- nvm
- Preserving Cache Copy if 5xx error or timeout with non-KV. HOT 1
- [Question] How to purge cache once new version of site is released?
- 404 page doesn't render in HTML but plain text HOT 1
- worker-rust example does not work
- Replace `service-worker-mock` w/ Miniflare
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from templates.