Summary
In this chapter, we explained the concepts of caching in web applications, including its benefits and use cases. We focused on a concrete example in our recipes app, detailed the requirement, and implemented it in a reactive way. We learned about the behavior of the shareReplay
operator and the alternative implementation using the share
operator in RxJS 7. We also learned how to implement a static cache and a cache with refresh capacity. Finally, we highlighted the most common use cases of caching.
In the next chapter, we will explore another useful reactive pattern that allows you to share data between your components. As usual, we will demystify the concepts and then learn the reactive way to do it.