Guide
Premium
Intermediate
Real Projects

HTTP Caching in Production: Cache-Control, ETags, stale-while-revalidate, and CDNs

Learn to make HTTP's own cache work for you: Cache-Control (max-age, s-maxage, immutable, stale-while-revalidate), ETags and conditional requests with 304, the hashed-assets vs always-revalidating HTML pattern, the Vary header, and CDN caching with invalidation and targeted headers. Expanded edition: Age and freshness arithmetic, weak ETags and Last-Modified, optimistic concurrency with If-Match and 412, cache keys and normalization, cache poisoning and cache deception, Authorization and signed URLs, request collapsing and micro-caching, surrogate keys, inside the browser cache (bfcache), service workers with Workbox, brotli and zstd, GraphQL and persisted queries, observability and header tests, systematic debugging, Next.js and ISR, 103 Early Hints, images and negotiation, Varnish and grace mode, a full case study, FAQ, and glossary. With production-ready code in FastAPI, Express, and nginx.

36 minutes read
1 views

Verificando acceso...

Loading comments...

Related Resources

Guía
PREMIUM

asyncio in Production: Never Block the Event Loop — TaskGroups, Cancellation and Bounded Concurrency

A practical asyncio guide for Python services in production: why blocking the event loop degrades the whole process without raising a single exception, how to catch it by measuring loop lag and with Python 3.14 introspection, structured concurrency with TaskGroup and handling ExceptionGroup via except*, the task the garbage collector makes vanish, timeouts with a deadline budget propagated across services, correct cancellation with cleanup and shield, bounded concurrency with semaphores and backpressured queues, synchronization primitives, and what changes with eager tasks, python -m asyncio pstree and free-threading. With production-ready code and a deployment checklist.

Guía
PREMIUM

Cache-Aside in Production: TTLs, Invalidation, and How to Prevent Cache Stampedes

The complete guide to the cache-aside pattern with Redis: jittered TTLs, correct invalidation, and the three defenses against cache stampedes (distributed lock, single-flight, and XFetch). Expanded with stale-while-revalidate, fail-open and circuit breakers, two-tier caching with RESP3 invalidation, delayed double delete and CDC, hot keys, eviction and memory management, observability with Prometheus, testing, choosing an engine (Redis, Valkey, Memcached), and a complete TypeScript implementation. With production-ready code in Python and TypeScript.

Guía
PREMIUM

Circuit Breakers: How to Prevent Cascading Failures in Distributed Systems

Learn to implement the circuit breaker pattern so a failing dependency never drags down your whole system: the three states (closed, open, half-open), sliding failure windows, limited probes to avoid thundering herds, robust fallbacks, and how to combine it with timeouts, retries, and bulkheads. Includes distributed state in Redis, observability with Prometheus, pytest testing, circuit breaking in Envoy/Istio, a full case study, and production-ready code in Python and TypeScript.