Closed kran6a closed 2 years ago
Hello, have you considered make-fetch-happen? It might be better for you since it supports caching based on headers.
Closing: make-fetch-happen is likely a better choice if you need caching based on response header semantics. This module is intended to cache everything. (I think you can even make make-fetch-happen cache everything too if you use the force-cache
option, which might make it an all-around better choice than this module, but I haven't tested how that works)
When using fetch in the browser only responses returning an appropriate
cache-control
header are cached. This is useful when dealing with uncachable responses or responses that expire at a different (or unpredictable) rate.By adding this option we spare entries from being vacuumed unlike using a interval-based approach since the
cache-control
header states how long the response can be cached and we know exactly which responses are stale and which are still fresh.