Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 537 Bytes

README.md

File metadata and controls

29 lines (24 loc) · 537 Bytes

koa-cache-control

html cache control for koajs

Install

  yarn add @redpill-paris/koa-cache-control

Configuration

Koa

const controlCache = require('@redpill-paris/koa-cache-control');

app.use(cacheControl([
    'no-cache'
]));

See html control cache parameters

Specific options

async getUser(ctx) {
    ...
    ctx.cacheControl = ['public', 'max-age=600'];
    ...
    ctx.response.status = 200;
}