A super fast website using Cloudflare workers
21–30 of 83 posts
Re: A super fast website using Cloudflare workers
#22> First visit: ~30ms. Real JavaScript executes at the edge. It appears to have static content. Why does it need any JS at all?
Looks like the only JavaScript running on the client is for installing the service worker and some Cloudflare tracking junk.
Re: A super fast website using Cloudflare workers
#23Earlier quoted context omitted.
But now it's that fast from almost everywhere on the planet, with nearly zero effort from the developer. We've been limited by light speed here, not compute.
I get 381ms/401ms on first load and not the claimed ~30ms. I'm not really sure what the point is here though. CDNs and browser cache headers work? Static sites are fast to paint?
Re: A super fast website using Cloudflare workers
#24> First visit: ~30ms. Real JavaScript executes at the edge. It appears to have static content. Why does it need any JS at all?
"At the edge" means "on a server located close to where you are". It's used to serve the HTML. Looks like the only JavaScript running on the client is for installing the service worker and some Cloudflare tracking junk.
Re: A super fast website using Cloudflare workers
#25another trick is adding speculation rules on MPA sites. so when you hover over a link the page gets prerendered. For example, my initial page takes ~80ms, but navigating to other pages take 20ms prerender: [ { where: { href_matches: '/*' }, eagerness: 'moderate' } ] That doesn't work on Safari, FF, and Brave, but you could do something like this: https://github.com/ericfortis/mockaton/blob/main/www/src/_as...
uBlock Origin does it by default for instance.
Re: A super fast website using Cloudflare workers
#26> First visit: ~30ms. Real JavaScript executes at the edge. It appears to have static content. Why does it need any JS at all?
"At the edge" means "on a server located close to where you are". It's used to serve the HTML. Looks like the only JavaScript running on the client is for installing the service worker and some Cloudflare tracking junk.
Re: A super fast website using Cloudflare workers
#27Earlier quoted context omitted.
"At the edge" means "on a server located close to where you are". It's used to serve the HTML. Looks like the only JavaScript running on the client is for installing the service worker and some Cloudflare tracking junk.
Right, but any old CDN can do that. Why does it need CF workers?
Re: A super fast website using Cloudflare workers
#28another trick is adding speculation rules on MPA sites. so when you hover over a link the page gets prerendered. For example, my initial page takes ~80ms, but navigating to other pages take 20ms prerender: [ { where: { href_matches: '/*' }, eagerness: 'moderate' } ] That doesn't work on Safari, FF, and Brave, but you could do something like this: https://github.com/ericfortis/mockaton/blob/main/www/src/_as...
Most adblockers/privacy extensions disable this. uBlock Origin does it by default for instance.
On Brave, the workaround on that linked snippet bypasses their blocking.
Re: A super fast website using Cloudflare workers
#29Add imagery and see if you get the same results. I expect you could achieve such with Base64 but the caveat would be larger file sizes.