/koa-no-cache

[koa-no-cache] no cache for some paths or types

Primary LanguageJavaScript

NPM version Build status Test coverage License Dependency status

koa-no-cache

no cache for koa apps

example

Adding no cache header on some paths or types

var noCache = require('koa-no-cache'),
  Koa = require('koa'),
  app = new Koa();

app.use(noCache({
  paths: ['/users/(.*)'],
  types: ['manifest']
}));

Adding no cache header globally

var noCache = require('koa-no-cache'),
  Koa = require('koa'),
  app = new Koa();

app.use(noCache({
  global: true
}));

License

MIT