Live data from Hacker News

A super fast website using Cloudflare workers

crazyfast.website

11–20 of 83 posts

Re: A super fast website using Cloudflare workers

#11
This is interesting and need to look into.

I decided to go check my website’s PageSpeed and I do have a 100/100/100/100 with pretty lots of content on the homepage including 6 separate thumbnails.

My site is on a straight path, no tricks — Github Pages Served to the Internet by Cloudflare.

Re: A super fast website using Cloudflare workers

#12
post #2

Speed: 74ms 241ms … LOL … These 30 ms and 4 ms numbers were typical Apache to Netscape from MAE East and MAE West in 1998. Twenty five years and orders of magnitude more computing later? Same numbers.

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

#14
One time I decided to check how much faster really you can go while still getting decent usability out of "simple blog platform" type of webapp.

End result, written in go, did around 80-200us to generate post page and 150-200us (on cheap linode VPS... probably far faster on my dev machine) for index page with a bunch of posts.

Core was basically

* pre-compile the templates

* load blogpost into RAM, pre-compile and cache the markdown part

cache could be easily kicked off to redis or similar but it's just text, there is no need

Fun stuff I hit around:

* runtime template loading takes a lot just for the type-casting; the template framework I used was basically thin veneer over Go code that got compiled to Go code when ran

* it was fast enough that multiple Write() vs one was noticeable on flame graph

* smart caching will get you everywhere if you get cache invalidation right, making the "slow" parts not matter; unless you're running years of content and gigabytes of text you probably don't want to cache it anywhere else than in RAM or at the very least have over-memory cache be second tier.

The project itself was rewrite of same thing that I tried in Perl(using Mojolicious) and even there it achieved single digit ms.

And it feels so... weird, using webpage that just reacts with speed that the well-written native app has. Whole design process was going against the ye olde "don't optimize prematurely" and it was complete success, looking at performance in each iteration of component paid off really quickly. We got robbed of so much time from badly running websites.

Re: A super fast website using Cloudflare workers

#15
post #2

Speed: 74ms 241ms … LOL … These 30 ms and 4 ms numbers were typical Apache to Netscape from MAE East and MAE West in 1998. Twenty five years and orders of magnitude more computing later? Same numbers.

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.

nah, most sites are fat enough that both bandwidth and compute is the limit.

Getting it closer can save you 50-150ms, but if whole load takes 1s+ that's minuscule

Re: A super fast website using Cloudflare workers

#17
another 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...

Re: A super fast website using Cloudflare workers

#19

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

nah, most sites are fat enough that both bandwidth and compute is the limit. Getting it closer can save you 50-150ms, but if whole load takes 1s+ that's minuscule

I only meant in this example. I agree, sites in general are fat.
Post reply on HN