@rill/fresh

1.0.1 • Public • Published

Rill
@rill/fresh
API stability Standard NPM version Downloads Gitter Chat

Check if a response is fresh and automatically send a 304 (not modified) status.

Installation

npm install @rill/fresh

Example

var fresh = require('@rill/fresh')
var etag = require('@rill/etag')
var rill = require('rill')
var app = rill()

// use it upstream from etag so
// that they are present

app.use(fresh())

// add etags

app.use(etag())

// respond

app.use(function ({ res }, next){
  res.body = {
    name: 'tobi',
    species: 'ferret',
    age: 2
  }
})

Contributions

  • Use npm test to run tests.

Please feel free to create a PR!

Package Sidebar

Install

npm i @rill/fresh

Weekly Downloads

4

Version

1.0.1

License

MIT

Last publish

Collaborators

  • dylanpiercey