A flexible Angular library for caching HTTP requests with support for memory, localStorage, and sessionStorage.
Cashew is an HTTP caching library for Angular applications that simplifies performance optimization by storing and reusing HTTP responses. It provides a clean, declarative API that integrates seamlessly with Angular's HttpClient and supports various caching strategies and storage backends.
Angular developers building applications that make frequent HTTP requests and need to improve performance by reducing network calls and server load.
Developers choose Cashew for its straightforward, declarative API that requires minimal configuration, its seamless integration with Angular's HttpClient, and its flexibility through multiple storage strategies and extensible architecture for complex caching scenarios.
🐿 A flexible and straightforward library that caches HTTP requests in Angular
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Seamlessly hooks into Angular's HttpClient using providers and context, requiring minimal boilerplate—just add `provideHttpCache` and use `withCache` in requests.
Supports in-memory, localStorage, and sessionStorage backends, allowing developers to choose persistence based on app needs, with versioning for cache management.
Offers a state management mode that caches only metadata (e.g., booleans) instead of full responses, preventing duplication with stores like Akita or NgRx.
Provides abstract classes for key serialization, storage, guards, and TTL, enabling deep customization for complex caching scenarios without forking the library.
localStorage and sessionStorage have 5-10MB size caps per the README, making Cashew impractical for caching large responses without careful monitoring and cleanup.
Tightly coupled to Angular's ecosystem (e.g., HttpClient, dependency injection), so it's unusable in non-Angular projects and adds vendor lock-in for teams.
Cache invalidation relies on TTL or programmatic clearing via CacheManager, which can be error-prone and requires diligent code maintenance to avoid stale data.