This week in caching: standing up FastCGI cache in nginx
Full-page caching without a plugin. Gold if you run nginx + PHP-FPM and want plugin-free speed.
— Declare the zone once — fastcgi_cache_path in the http block with a sized keys_zone; undersize it and nginx evicts hot pages constantly.
— Build a precise cache key — include scheme, host, request_uri; forget the host and two domains collide in one cache.
— Skip the dynamic stuff — set fastcgi_cache_bypass and fastcgi_no_cache for logged-in cookies, POST, and admin paths.
— Add stale-on-error — fastcgi_cache_use_stale error timeout updating serves the last good page when PHP-FPM chokes.
— Expose a debug header — add_header X-Cache $upstream_cache_status so you can see HIT/MISS/BYPASS live.
Credit to the nginx admin guide and Jonathan Nicol's classic FastCGI-cache + WP tutorial.
Bookmark: nginx's ngx_http_fastcgi_module docs — the authoritative directive list.
Cache Catch
@CacheCatch
This week in caching: standing up FastCGI cache in nginx
Этот пост опубликован в Telegram-канале Cache Catch. Подписаться можно по ссылке: @CacheCatch.