Package Exports
- popsicle-cache
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (popsicle-cache) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Popsicle Cache
Override the Popsicle transport mechanism with HTTP caching.
Installation
npm install popsicle-cache --save
Usage
var popsicle = require('popsicle')
var cache = require('popsicle-cache')
popsicle('http://example.com')
.use(cache())
.then(function (res) {
console.log(res) //=> If fresh, the cached response, otherwise makes a new request.
})
Options
- store Create a custom store option for request data (default:
FileSystemMemoryStore
) - staleFallback Fallback to the stale response when network is unavailable (default:
true
)
Please note: Streaming response bodies skip the cache.
License
MIT license