kwhitley / apicache

Simple API-caching middleware for Express/Node.
MIT License
1.24k stars 193 forks source link

cache-control global options not working correctly #239

Open springyboy opened 3 years ago

springyboy commented 3 years ago

Hi,

Is there a bug in the newly implement global options for cache-control?

It looks like the method sendCachedResponse (apicache.js 258) does not check the global options for the header cache-control and writes a new cache-control header with a reduced max-age. This causes the browser to cache the response from the api even if the global option cache-control is specified as no-cache.

I could be wrong.

Izook commented 3 years ago

You might want to look at #205. It looks like this package is losing support but there's a fork of this package with this improvement.

ravinatesanatr commented 2 years ago

This seems to be a defect. It's happening for us too.