Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/phillipj/request-cache

Cache wrapper around the popular request.js module
https://github.com/phillipj/request-cache

Last synced: about 1 month ago
JSON representation

Cache wrapper around the popular request.js module

Awesome Lists containing this project

README

        

# request-cache

[![Build Status](https://api.travis-ci.org/phillipj/request-cache.png?branch=master)](http://travis-ci.org/phillipj/request-cache)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)

Cache wrapper around the popular request.js module.

## TL;DR

- Has the same API as [request](https://www.npmjs.com/package/request)
- Cache content based on response cache headers
- You control which version of `request` to use
- Follows [RFC7234](https://tools.ietf.org/html/rfc7234)

## Usage

```js
var cache = require('request-cache')
var request = cache(require('request'))

request('http://example.com', function(err, res, body){
console.log('Response from example.com', body)

request('http://example.com', function(err, res, body){
console.log('Cached response from example.com', body)
})
})
```

## Still very much work in progress!

# Contributing

request-cache is an **OPEN Open Source Project**. This means that:

> Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.

See the [contribution guide](CONTRIBUTING.md) for more details.

# Contributors

Phillip JohnsenGitHub/phillipjTwitter/@phillipjohnsen

# License

Copyright © 2015 **request-cache** contributors.

**request-cache** is licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included `LICENSE.md` file for more details.