cache-header
Get and set the response cache header
Last updated 12 years ago by scottcorgan .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install cache-header 
SYNC missed versions from official npm registry.

cache-header

Get and set the response cache header

Install

npm install cache-header --save

Usage

var express = require('express');
var cacheHeader = require('cache-header');

var app = express();

app.use(function (req, res, next) {
  // Sets Cache-Control header to public, max-age=10000
  cacheHeader(res, 10000);
  next();
});

app.listen(3000, function () {
  
});

cacheHeader(responseObject, headerValue)

  • responseObject - the response object passed through by Node
  • headerValue - value to set the header to. Can be the following types:
    • false - sets value to no-cache
    • number - a number or a parseable string. Sets header to public, max-age={number}
    • string - sets the header to whatever the string is

Run Tests

npm install
npm test

Current Tags

  • 1.0.3                                ...           latest (12 years ago)

4 Versions

  • 1.0.3                                ...           12 years ago
  • 1.0.2                                ...           12 years ago
  • 1.0.1                                ...           12 years ago
  • 1.0.0                                ...           12 years ago
Maintainers (1)
Downloads
Total 8
Today 0
This Week 4
This Month 8
Last Day 0
Last Week 4
Last Month 0
Dependencies (3)
Dev Dependencies (3)
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE