Koa middleware to disable client-side caching for specified paths or content types. Version 2.0.0 is current; low maintenance, last updated 2018. Uses path-to-regexp for route matching and type-is for content type detection. Differentiators: lightweight, simple API with global or selective caching disablement.
npm install koa-no-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a Koa app and applies no-cache headers for paths starting with /api/ and for JSON/HTML responses.
Ensure path patterns follow path-to-regexp format, e.g., '/users/:id'.
Consider forking or using alternatives like koa-conditional-get or koa-etag.
Provide correct MIME types such as 'text/html', 'application/json'.
Place middleware after routes or other middleware that sets response content.
Use 'import noCache from 'koa-no-cache'' or 'const noCache = require('koa-no-cache')'.Run 'npm install koa-no-cache'
Ensure you call noCache({...}) before passing to app.use().No dependency data recorded yet.