Back-to-back fetch() calls open two connections, not one
A loop of awaited fetch() calls to one host keeps exactly two sockets open. I measured why, and the one-line change that drops it to one.
16 posts
A loop of awaited fetch() calls to one host keeps exactly two sockets open. I measured why, and the one-line change that drops it to one.
p-queue leaves dequeued items in place and moves a head pointer instead. I measured the difference: shift() took 3.5s where the pointer took 2.6ms.
A delay over 24.9 days overflows a 32-bit int, so setTimeout runs at once. What I measured in Node and Chrome, plus a long-timer fix.
I built a fake Postgres server to watch postgres.js on the wire. Ten queries left in one packet — but the first run of each one always waits alone.
A nullable Drizzle column is required when you read a row and optional when you write one. I read the source and compiled proofs of the exact rule.
I tested pino's sonic-boom write stream: it does not buffer log lines by default, and a full buffer drops lines while write() still returns true.
Everyone says console.time() breaks under concurrency because the second call overwrites the first. I tested it in Node, Bun and Deno, and that is not what happens. The second timer is thrown away, the fast request reports the slow request's duration, and the slow request reports nothing at all.
A 5-per-300ms rate limit let 9 calls through in a 30 millisecond span. Not a bug — the default window type. Here is what I measured, why it happens, and the one option that fixes it.
A component that logs on every render can fire dozens of network requests per second. Here's how per-level throttle, debounce and rate-limit policies fix it — including the one-word config typo that silently brings the flood right back.
Four small resilience features that, combined, are the difference between an app that shrugs off a bad network and one that falls apart on a train.
Three cache strategies, why the cache key includes more than the URL, and how to invalidate cleanly after a mutation.
A practical walk through the vercel.json headers block I ship in production — HSTS, X-Frame-Options, X-Content-Type-Options, Permissions-Policy, and immutable long-cache for hashed assets, fonts, and images.
Why the Google Fonts <link> blocks rendering, and how importing @fontsource-variable/jetbrains-mono in your entry file ships the font with your bundle for a faster first paint.
Add lightweight, cookie-free analytics to Astro with @vercel/analytics in a tiny reusable component — what it does, when it loads, and how to wire it up.
Add fast, fully client-side search to a static Astro blog using Pagefind — no server, no API, and no query ever leaving the visitor's browser.
Mermaid is a big library, and most blog posts have zero diagrams. Here's the one-guard pattern I use so only posts that actually contain a diagram download the mermaid JavaScript.