0.1.6 • Published 2 months ago
fetchache v0.1.6
Fetchache
A fetch wrapper that allows you to respect HTTP caching strategies on non-browser environments with a key-value cache implementation. It follows the HTTP Caching and Conditional Requests standards.
Installation
yarn add fetchache
Usage
import { fetchFactory } from 'fetchache'
import { fetch, Response } from 'some-fetch-impl'
// We recommend using `@whatwg-node/fetch`
const someCacheImpl = {
get: async key => {
// Get the cached value from your cache implementation
},
set: async (key, value) => {
// Set the cached value to your cache implementation
}
}
const fetchWithCache = fetchFactory({
fetch,
Response,
cache
})
// Then you can use it like a normal fetch
const response = await fetchWithCache('https://example.com')
0.1.6
2 months ago
0.2.0-alpha-20230215090500-a3d0322
2 years ago
0.2.0-alpha-20230215085143-56e6bef
2 years ago
0.1.5-rc-20230320124940-870b034
2 years ago
0.1.5-alpha-20230320123631-3fc1dd7
2 years ago
0.1.5-alpha-20230320124321-e6b82e7
2 years ago
0.2.0-alpha-20230215085115-d099e0b
2 years ago
0.2.0-alpha-20230215085620-3393c60
2 years ago
0.1.5
2 years ago
0.1.3-alpha-20220907115414-e18c239
2 years ago
0.1.4
2 years ago
0.1.3
2 years ago
0.1.2
2 years ago
0.1.0
3 years ago
0.1.1
3 years ago
0.0.4
4 years ago
0.0.3
5 years ago
0.0.2
5 years ago
0.0.1
5 years ago