apicache
apicache copied to clipboard
Header option bugs
Middleware localOptions.headers currently are ignored (only globalOptions.headers are used) https://github.com/kwhitley/apicache/blob/f27cb2b30719e8eb35ef98c6c019dd1d5ec96732/src/apicache.js#L189-L195
Also, following code is ignoring the possibility of cacheObject.headers['cache-control']
being a value previously overrided by global/localOptions, like e.g. max-age=0, must-revalidate
or no-cache
or maybe a max-age lower than that being currently set.
I mean, if there was global/localOptions.headers['cache-control'] that was used when caching response, i think it should be used when sending cached response
https://github.com/kwhitley/apicache/blob/f27cb2b30719e8eb35ef98c6c019dd1d5ec96732/src/apicache.js#L251-L259
I think #163 tries to fix the same issue with not counting that 'cache-control' could already be set... This is really bugging me as well, as I do invalidate my cache on every write to the DB and don't want my clients to sit around with stale responses...
@kwhitley Any chance this could be fixed soon? I had to disable my cache again due to not being able to override the cache-control header...