
Templ Streaming and Partial Rendering for Faster Pages
Stream templ pages with templ.Flush and WithStreaming so the shell reaches the browser before slow data is ready, and see what a failed streamed render does.
Profile first, then change something. pprof, allocations, the garbage collector, escape analysis and benchmarks that hold up in production.

Stream templ pages with templ.Flush and WithStreaming so the shell reaches the browser before slow data is ready, and see what a failed streamed render does.

Cache API data in Redis from Go: cache-aside with singleflight, a version fence against stale writes, namespace versions for lists and TTL jitter, on Redis 8.

Build an in-memory response cache for Go handlers with keys, a TTL, Vary awareness, a singleflight stampede guard and rules for what must never be cached.

Serve net/http/pprof from a separate loopback listener with a token, avoid the DefaultServeMux trap, and fix the WriteTimeout error on CPU profiles.

Serve a 200,000-row JSON export in Go by streaming rows from the database: first byte in 1 ms instead of 161, 1 MB of heap instead of 57, and gzip on the fly.

Walk through every http.Transport field that matters in production, with the default value, what changing it does and measured effects of connection limits.

Add strong ETags and If-None-Match handling to Go handlers, including weak comparison, lists of tags and a 304 that repeats the right headers.

See when the Go HTTP client reuses a connection and when it dials a new one, using httptrace, and how idle timeouts and Connection close change that.

Choose Cache-Control values for fingerprinted assets, HTML pages, API responses and private data in a Go server, and set them from one small middleware.

Compare templ and html/template on the same 100 row page: render speed and allocations, error timing, escaping, tooling and when each is the right choice.

Make JSON API revalidation cheap in Go: ETags from a revision column, collection tags, exact If-None-Match matching, 304 headers and 10x less work.
We send one email when a new article is published. No spam.