In this implementation there is an addition of LRU cache in the Resource caching.
When a resource of a type has maxAge set and has multiple keys associated with it, in that case there would be multiple resources with different keys which would be cached in the store. This could lead to heavy memory consumption on the browser.
In order to have a check, maxCache has been added.
When a particular resource type is given a maxCache value, then it will restrict the caching of resources to that number.
Once the cache is full, then whenever a new resource is requested, it will delete the least recently used resource and make space for the new resource.
In this implementation there is an addition of LRU cache in the Resource caching. When a resource of a
type
has maxAge set and has multiple keys associated with it, in that case there would be multiple resources with different keys which would be cached in the store. This could lead to heavy memory consumption on the browser. In order to have a check,maxCache
has been added. When a particular resourcetype
is given amaxCache
value, then it will restrict the caching of resources to that number. Once the cache is full, then whenever a new resource is requested, it will delete the least recently used resource and make space for the new resource.