This website is fucking fast.
← Back to logbook
How is this so speedy?
I literally work for vercel but imma be honest... this is much faster than anything you can deploy on vercel. for a couple of reasons:
The files themselves are small- The html files only have the minimum amount of tags needed to make the page work. This means that there's no opening/closing
html
or body
tags, for example. We can do this because the browser is shockingly (dangerously?) forgiving.
Build/deploy time- Build script is less than 1s to run, and generates all static files.
- It takes around 30 seconds in a GHA to deploy. Vercel does some caching for builds so it might be faster (I'll have to test tbh) but deploying from a cold start in under 30s is quite quick. This includes doing SSG, minification, and brotli compression along with setup/teardown.
- I deploy with the
wrangler
cli. If I'm on staging
I get a temporary preview URL, and if I'm on main
it deploys to ai-2035.com
.
Compression- This uses brotli level 11 compression, which then is configured in Cloudflare with a
_headers
file to tell the browser to use it. - Some stats: With brotli compression, the homepage is 468 bytes (60% reduction from the uncompressed size) and the average page is 0.31 KB. So this means that all websites fit in a single UDP packet.
Cloudflare- Uses cloudflare's edge network, so files are served from the cloest edge location to the request. This includes connection reuse and 0-RTT resumption.
- They have over 300 POPs with failover, too.
- TL;DR it's speedy af.
Quick tests- WebPageTest: Virginia on 4G on a motorola: 0.623s TTFB and 1s LCP.
- WebPageTest: Virginia on cable on chrome: 0.227s TTFB, and 0.331s LCP.
- WebPageTest: Mumbai on 3G on a motorola: 1.239s TTFB, 1.497s LCP.
- WebPageTest: Frankfurt on cable on chrome: 0.277s TTFB, and 0.423 LCP.
Drawbacks
A few drawbacks of making a website this way:
No dynamic content- Obviously you lose this. but that's not what you make a static site/blog for anyways, so i'm ok with it.
DX is worse- The developer experience on cloudflare is complete ass. they have a horrific ui that's a pain to navigate. I spent more time configuring DNS and using CF pages than I did coding.
- I have a solid nextjs workflow so having to actually set up CI/CD and a build script is annoying.