Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 415 Bytes

README.md

File metadata and controls

26 lines (20 loc) · 415 Bytes

USAGE

  const Cache = require('dobi-cache');
  const { cache, flushCache } = new Cache({
    disabled: false,
    keyPrefix: 'myKeyPrefix',
    redisUri: 'localhost'
  });


  app.get('/', cache('5 minutes'), (ctx) => {
    ctx.body = 'hello world'
  })

  app.get('/bar', cache({
    age: 300,
    query: ['name', 'title'],
  });

  app.get('/bar', cache({
    age: '5 minutes',
    query: '*'
  });