Problem/Motivation

Assuming that we have implemented a way to evict the cache, we can then expose an option on individual request methods to 'refresh' the cache. This will first evict the cache at the specified cache key, and then make a fresh API request that will then be cached.

Steps to reproduce

* Make a cached request.
* It lives in the cache forever.

Proposed resolution

* For methods that accept a getOptions object (getCollection, getResource, getResourceByPath in JsonApiClient, translatePath in DecoupledRouterClient) add a refreshCache option. If this is true, the cache at the resulting key will be evicted/removed and then the API call will proceed as normal.

Remaining tasks

* Update the getOptions interface to include a refreshCache option.
* Honor this option in JsonApiClient methods - getResource, getCollection, getResource by path.
* Honor this option in decoupledRouterClient methods - translatePath.
* Add test coverage.
* Update documentation.

API changes

* Get methods will now accept a refreshCache option.

Comments

brianperry created an issue. See original summary.

brianperry’s picture

Priority: Normal » Major