Caching Strategies
“There are only two hard things in computer science: cache invalidation and naming things.” – Phil Karlton
Caching can significantly enhance a website’s performance by eliminating or shortening network roundtrips and reusing previously stored data and content. However, caching is also hard to get right. As usual, Remix provides a thin abstraction layer on top of the web platform and eases the usage of HTTP caching strategies.
In this chapter, we will learn about different caching strategies and how to utilize them with Remix. This chapter is divided into two sections:
- Working with HTTP caching
- Exploring in-memory caching
First, we will learn about HTTP caching. We will study different HTTP caching headers and see how we can utilize HTTP caching in the browser and with CDNs. Next, we will focus on in-memory caching. We will refer to Chapter 3, Deployment Targets, Adapters, and Stacks, to understand when and where...