Currently seeking a cache solution for my Angular2 application.
Imagine we have a massive collection of Movie
objects stored on a server, too many to fetch all at once. The server offers a REST endpoint: getMovie(String id)
On the client side, I need a straightforward way in Angular to retrieve a movie using something like
cache.getMovie(id:string): Observable<Movie>
. This should only call the REST endpoint for the initial request and then save it locally for subsequent calls.
In Angular1, there are options like angular-cache or $cacheFactory, which offer features like LRU support.
I initially started creating a simple cache system using a local HashMap, but this seems like a common requirement.
Are there any recommended in-memory cache solutions available for Angular2?