# Egghead Lesson: Simple caching with RxJS

DevFeed: [Egghead Lesson: Simple caching with RxJS](<https://devfeed.tech/articles/egghead-lesson-simple-caching-with-rxjs-21336.md>)

Original publisher: [Read original article](<https://juri.dev/blog/2018/11/videolesson-rxjs-caching-angular/>)

Published: 2018-11-10T00:00:00Z

Content type: article

Language: en

Sources: [Juri Strumpflohner](<https://devfeed.tech/sources/juri-strumpflohner.md>)

Topics: [Cache](<https://devfeed.tech/topics/cache.md>), [switchMap](<https://devfeed.tech/topics/switchmap.md>), [Front end](<https://devfeed.tech/topics/frontend.md>), [software-development](<https://devfeed.tech/topics/software-development.md>), [Amazon ElastiCache](<https://devfeed.tech/topics/amazon-elasticache.md>), [Redis](<https://devfeed.tech/topics/redis.md>)

Tags: [angular](<https://devfeed.tech/tags/angular.md>), [api](<https://devfeed.tech/tags/api.md>), [cache](<https://devfeed.tech/tags/cache.md>), [caching](<https://devfeed.tech/tags/caching.md>), [data-freshness](<https://devfeed.tech/tags/data-freshness.md>), [database](<https://devfeed.tech/tags/database.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [egghead](<https://devfeed.tech/tags/egghead.md>), [headers](<https://devfeed.tech/tags/headers.md>), [in-memory-database](<https://devfeed.tech/tags/in-memory-database.md>), [optimizations](<https://devfeed.tech/tags/optimizations.md>), [performance](<https://devfeed.tech/tags/performance.md>), [redis](<https://devfeed.tech/tags/redis.md>), [rxjs](<https://devfeed.tech/tags/rxjs.md>), [state-management](<https://devfeed.tech/tags/state-management.md>), [store](<https://devfeed.tech/tags/store.md>)

## AI overview

The article presents a simple RxJS-based caching mechanism for Angular, based largely on an implementation described in a Thoughtram article and covered in an Egghead lesson. It cautions that cache invalidation and debugging are difficult because cached data can become stale or hide expected results. The author recommends delaying client-side caching until other optimizations have been tried and considering API-level caching, where data freshness is easier to assess. It notes that NgRx stores can act as an in-memory cache, with the same risk of stale data. The excerpt links to a video and StackBlitz example but does not explain the implementation.

## Source excerpt

Lorem ipsum dolor sit amet