Caching is used to store application data, which is expensive to generate during runtime. Therefore, instead of generating data every time a user requests for it, we compute it once and deliver the cached data every time until the cache data is invalidated. This usually improves response time and reduces the need for processing power drastically. The invalidation could be time dependent or dependent on data change. Caching in itself is a huge topic and cannot be explained in a lot of detail in this book. However, we will be learning about how Redis can be used effectively to cache data in later sections.
For the sake of simplicity, consider we have a web page, which shows a set of 30 products with a distinct dataset for each title, image, and price. The ordering of the products as well as the selection is based on the popularity and diversity logic of the application. We know for a fact that the price of the product does not change for six hours and that the title and image...