Server-side caching stores frequently requested application data in a server-side or server-accessible data store so later requests can reuse it with less effort. It can reduce pressure on a database, network resource, or filesystem, especially when many requests retrieve the same data. section 3.1.3
Common server-side caching arrangements include:
- An in-memory cache stores data in high-performance system memory. section 3.1.3
- A distributed cache stores data in a shared service accessible across application instances. section 8.1
- A key/value store can be provided by Memcached, Redis, Couchbase, Amazon ElastiCache, or a standard database management system. section 3.1.3
Applying the strategy to a board-game API
A RESTful board-game API can combine HTTP response caching for frequently accessed GET endpoints with in-memory or distributed caching for expensive or recurrent database queries. The appropriate level depends on whether clients request the same response or select specific data. section 8.1
Server-side caching differs from client-side caching, which uses HTTP response headers, and intermediate caching, which uses proxies or CDNs. A layered strategy caches at the highest practical level: responses for identical results, and server-side data for reducing database calls. section 3.1.3 section 8.1
