Micro-cache nginx so WordPress survives a spike
A 1-second cache turned my $5 box into something that ate a front-page Reddit hit:
— fastcgi_cache_path /tmp/nginxcache levels=1:2 keys_zone=MICRO:10m max_size=200m inactive=60m;
— In the location block: fastcgi_cache MICRO; and fastcgi_cache_valid 200 1s;
— Skip logged-in users: fastcgi_cache_bypass $cookie_logged_in; and same for no_cache
— Add fastcgi_cache_use_stale updating error timeout; so one request rebuilds while others get served
10k visits/day on a box that used to fold at 500. Try it tonight.
Root Access Daily
@RootAccessDaily
Micro-cache nginx so WordPress survives a spike
Этот пост опубликован в Telegram-канале Root Access Daily. Подписаться можно по ссылке: @RootAccessDaily.