Worker sites vs pages

Hello there everybody! I've come here with a big question after exploring https://developers.cloudflare.com/workers/platform/sites/ What is the big difference between worker sites and cf pages?
Workers Sites · Cloudflare Workers docs
Workers Sites enables developers to deploy static applications directly to Workers. It can be used for deploying applications built with static site …
16 Replies
Erisa
Erisa•2y ago
It can be thought of as the precursor to Pages, and uses https://github.com/cloudflare/kv-asset-handler to allow you to easily bundle and serve web assets in KV with your Worker or run an entire website on Workers+KV. It was a lot more complex to setup and use, and didn't provide a built-in CI/CD, opinionated defaults or file-based routing like Functions has. These days there are not a lot of reasons to use Workers Sites, because Pages + Functions will manage almost all of the same things you could have done, and costs less (no cost for static assets on Pages)
lmtr0
lmtr0OP•2y ago
speed wise, are they the same?
Erisa
Erisa•2y ago
Should be the same since theyre doing very similar things, Pages is also built on Workers and also uses KV on the backend
lmtr0
lmtr0OP•2y ago
interesting lastly, what If I want to use http3 in workers?
Erisa
Erisa•2y ago
For serving a Worker on http3? Should work on a custom domain/route but won't work on workers.dev
lmtr0
lmtr0OP•2y ago
Ok if i'm in that specific domain and have enabled the http3 anything else I should do? one more thing, is kv and r2 similar in speed?
Chaika
Chaika•2y ago
might take a few refreshes. HTTP3 isn't something that can be upgraded to during the initial connection like http2 is. Looks like some browsers wait until the existing tcp connection dies to switch, and some switch more aggressively No, KV is faster, R2 is slower, much slower if you don't manually cache it. R2 has a single origin, and does not cache by default. KV has two central stores (1 in EU, one in US) and each colo your worker runs in/fetches the KV value will cache it, for a minimum of 60s. KV 2.0 (WIP) even revalidates it in the background, letting you set a cache of days and having changes still be reflected within a minute or so. There are other reasons you might pick R2 though. It is cheaper, supports larger files/values then 25MB, and is strongly consistent. https://developers.cloudflare.com/workers/platform/storage-options/
lmtr0
lmtr0OP•2y ago
I've enabled it about a week ago
Chaika
Chaika•2y ago
what's your domain?
lmtr0
lmtr0OP•2y ago
warpfactor.co
Chaika
Chaika•2y ago
Are you sure? That website isn't returning the alt-svc header
lmtr0
lmtr0OP•2y ago
hmmm let me check again
Chaika
Chaika•2y ago
It's under Network -> third result down, HTTP/3, if it helps
lmtr0
lmtr0OP•2y ago
thx it wasn't sorry
Chaika
Chaika•2y ago
no worries, welcome to http/3 🙂
lmtr0
lmtr0OP•2y ago
thx
Want results from more Discord servers?
Add your server