svrcekmichal / redux-axios-middleware

Redux middleware for fetching data with axios HTTP client
MIT License
918 stars 96 forks source link

[feature] caching w/ age param #45

Open crobinson42 opened 7 years ago

crobinson42 commented 7 years ago

What do you guys think about adding a caching option for requests? We could implement an option w/ the cache to bypass cache if last request is older than age or something along those lines... thoughts?

crobinson42 commented 7 years ago

If this is outside the scope of the library - what about creating another project that can be included separately and used as a sort of plugin middleware to the req/res lifecycle and configurable to meet the needs of caching?

nmaves commented 7 years ago

I think this is a bit outside the scope of this project but wanted to get others input on it.

I do like the idea of it but there are so many implementations of caches. Would we only have our own in memory cache or allow for pluggable caches implementations (think memcached, ignite ...)

@svrcekmichal you think this is something we would want in this library?

crobinson42 commented 7 years ago

Something to consider - If the approach to create a separate project that's a configurable plugin is something we see useful, we'll still need to change some minor things in this project's source code to include the plugin into the lifecycle of the redux dispatch state.