1.0.4 • Published 4 years ago

@redpill-paris/koa-cache-control v1.0.4

Weekly downloads
12
License
MIT
Repository
-
Last release
4 years ago

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;
}