cache-header-control
Control the response cache header
Install
npm install cache-header-control --save
Usage
var express = ;var setCacheHeader = ; var app = ; app; app;
setCacheHeader(responseObject, timeValue)
responseObject
- the response object passed through by NodetimeValue
- themax-age
,Expires
value to set the headers. Can be the following types:false
|undefined
|null
|''
|0
|negative number:-2
,'-3'
- sets value tono-cache, no-store, must-revalidate
number
- a number or a string can be parse to a number. Sets theCache-Control
header topublic, max-age={number}
andExpires
header to{number}
string
can be:'minute'
- 600(10 minutes)'hour'
- 3600(1 hour)'day'
- 86400(1 day)
Run Tests
npm install
npm test