Catalogue / stackoverflow-2019-app-caching

Stack Overflow caches in web server memory first and in two Redis servers per data center second, and output-caches no pages

Stack Overflow, 2019. Application caching layer of the Stack Exchange network.

Organisation
Stack Overflow
Evidence
Reported from production
Source
Stack Overflow: How We Do App Caching - 2019 Edition

Nick Craver's blog, published 2019-08-06

Records

Decision#d1

Read from web server memory first, fall back to Redis, and purge local copies through a pub/sub channel

Decision#d2

Serve stale cache entries while one background refresh runs, behind a per-server lock per key

Decision#d3

Keep two plain Redis servers per data center and use neither Redis Cluster nor Redis Sentinel

Decision#d4

Stop output-caching whole pages; cache full responses, by a separate mechanism, only on some RSS routes

Sign in to read what was chosen, what was rejected and what it cost, each with its place in the source. An account is free. The job-queue cards are open without one.