Skip to content
This repository has been archived by the owner on Nov 5, 2018. It is now read-only.

DEPRECATED HTTP client with a transparent filesystem-based cache

License

Notifications You must be signed in to change notification settings

strongloop-archive/strong-caching-http-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Caching HTTP Client

Build Status NPM version

Overview

Strong-caching-http-client is an HTTP client with a transparent filesystem-based cache.

Usage

Installation

$ npm install strong-caching-http-client

API

The API is similar to the API of request.

var client = require('strong-caching-http-client');

client.request(
  'http://nodejs.org/',
  {
    cache: '/tmp/http-client-cache'
  },
  function(err, resp) {
    // resp is http.IncomingMessage
  }
);

Options:

  • cache Path to the directory where the client should keep cached data.
  • method GET/POST/etc.
  • headers Request headers (optional).
  • body Request body (optional). Either String, Buffer or Stream.
  • maxAge Accept a cached response whose age is no greater that the specified time in seconds. Default: 60.
  • maxStale Accept a cached response that has exceeded its expiration time (as set by maxAge option) by no more than the specified time in seconds.

About

DEPRECATED HTTP client with a transparent filesystem-based cache

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published