liveBook · Manning

Server-side caching

As explained in Building Web APIs with ASP.NET Core

Server-side caching is a caching technique that stores application data on the server or in a server-accessible data store for reuse across requests.

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

How Building Web APIs with ASP.NET Core covers it

How deep it goes
Defines the technique, distinguishes its placement from other caching types, and explains strategic selection without showing implementation steps.
Examples
Uses system memory, Memcached, Redis, Couchbase, Amazon ElastiCache, and recurrent board-game API queries as examples.
What it assumes
Defines caching and its major categories from the basics while assuming familiarity with HTTP requests, APIs, and databases.
What you can do after
Apply it by choosing in-memory, distributed, or response caching according to request repetition and database load.
How it connects
Connects server-side caching with HTTP response caching, in-memory caching, distributed caching, CDN caching, and database management systems.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building Web APIs with ASP.NET Core. The section links point to the parts of the book it draws on.