Static file serving middleware for Koa with caching, gzip support, and MD5 ETags. Current version 5.1.4, maintained as part of the koajs organization. Unlike koa-static, it caches files on initialization (preload) by default, supports in-memory buffering, pre-compressed gzip files, and alias mappings. No directory listing or index.html support. Suitable for production static asset serving with minimal overhead.
npm install koa-static-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up a Koa server with static file caching from 'public' directory, including gzip support and in-memory buffering.
Upgrade Node.js to version 7.6.0 or later.
Pass directory path as first argument instead of using options.dir.
Set options.dynamic = true to enable dynamic file loading for files not cached on initialization.
Pre-generate .gz versions of your static files, e.g., using a build step.
Ensure the directory exists and the path is absolute (use path.join(__dirname, 'public') or path.resolve('public')).Use `import staticCache from 'koa-static-cache'` or `const staticCache = require('koa-static-cache')`.Run `npm install koa-static-cache` in your project directory.
No dependency data recorded yet.