concept memory in category isomorphic web applications

appears as: memory
Isomorphic Web Applications: Universal Development with React

This is an excerpt from Manning's book Isomorphic Web Applications: Universal Development with React.

Another powerful server performance tool is caching. I’ve employed caching in different forms, including edge caching, in-memory caching, and saving views in a Redis (a NoSQL database) persisted cache. Each of these strategies has trade-offs, so it’s important to understand what these are and then pick the right strategy for your use case. Table 11.1 lists caching options.

11.3.1. Caching on the server: in-memory caching

The easiest (and most naïve) solution for caching involves saving components directly in memory. For simple apps, you can achieve this by using a basic LRU cache (size-limited) and stringifying your components after they’re rendered. Figure 11.3 shows a timeline of using an in-memory cache. The first user to load a page gets a fully rendered (and slower) version of the page. This is also saved in the in-memory cache. All subsequent users get the cached version, until that page gets pushed out of the cache because the cache filled up.

Figure 11.3. In-memory caching allows some requests to benefit from faster response times.