← Graph

Static Page Caching via nginx

concept 2 connections

By writing pre-rendered HTML (and pre-compressed .gz files) into Rails' public/cache directory, nginx can serve requests without ever contacting the Rails app — the fastest possible path. Requires an expire_cache method invoked on update/destroy callbacks to delete stale files. Scales to per-user variants via cookie-based nginx routing; at 10M users, 28KB gzipped pages cost ~0.26TB of disk, considered cheap.

category
pattern
about
Static Page Caching via nginx concept
Describes writing cached pages to public/cache for nginx to serve directly.
about
Static Page Caching via nginx concept
Concrete takeaway for nginx static cache pattern.

Provenance

Read by
18 extractions