Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch from using custom HTTP client caching to
make-fetch-happen
.
This is a similar treatment as to what was applied to `@apollo/gateway` in @trevor-sheer's #3783. This replaces a local HTTP cache implementation which continues to grow in complexity with an off-the-shelf Fetch API client with many valuable bells and whistles. In particular, it uses `make-fetch-happen`, which is a relatively full-featured Node.js based implementation which is used by `npm` itself and leverages `minipass-fetch` under the hood. This leverages the same cache implementation used in `@apollo/gateway` and duplicates that cache logic. It's entirely possible we would be well-served to use the `cache.js` example that's included in the source of `make-fetch-happen` and leverages `cacache`, but as of this message, it doesn't include the TypeScript types and this implementation seems to work. Ref: https://npm.im/make-fetch-happen Ref: https://npm.im/minipass-fetch Ref: https://npm.im/cacache Ref: https://github.com/npm/make-fetch-happen/blob/b04c4c16/cache.js
- Loading branch information