I'd like to override got caching so to extend what the remote headers ask me to do.
I currently use the max-stale
in the request header to extend somehow the caching, but this doesn't work if the remote service use strict caching headers and got doesn't even store them.
I tried manipulating response headers in the .on('response', )
hook, but this doesn't work. Sounds like got caches the manipulated response, but the cachecontrol is precomputed into a different property and uses the original cache-control.
I guess this is something happending in cacheable-request
makeRequest's response handler that calls the ee.emit('response')
AFTER storing the response, so maybe I should open an issue against the "cacheable-request" project, but my knowledge of got internals is very limited, so I preferred to start with this question as maybe you can identify a better way or a workaround to alter if and how long got caches a result.
There is a $60.00 open bounty on this issue. Add more on Issuehunt.
- Checkout the Issuehunt explorer to discover more funded issues.
- Need some help from other developers? Add your repositories on Issuehunt to raise funds.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too