
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
Etag support for Koa responses using etag.
Please use @koa/etag (v5+) instead. It is the same module, and this package will be deprecated in the next major release.
# npm
$ npm install koa-etag
# yarn
$ yarn add koa-etag
const Koa = require('koa');
const etag = require('koa-etag');
const conditional = require('koa-conditional-get');
const compress = require('koa-compress');
const app = new Koa();
// must be used before `conditional` and `etag`
app.use(compress());
// etag works together with conditional-get
app.use(conditional());
app.use(etag());
app.use(function (ctx) {
ctx.body = 'Hello World';
});
app.listen(3000);
console.log('listening on port 3000');
The etag package is a standalone utility for generating ETag HTTP headers. Unlike koa-etag, it is not specific to Koa and can be used with any Node.js HTTP server. It provides more granular control over ETag generation but requires manual integration.
The koa-conditional-get package is a middleware for Koa that handles conditional GET requests using If-None-Match and If-Modified-Since headers. While it does not generate ETags itself, it works well in combination with koa-etag to provide a complete caching solution.
The koa-static package serves static files and includes built-in support for ETag headers. It is more specialized for serving static assets, whereas koa-etag is more general-purpose and can be used with any type of response.
FAQs
Koa ETag support middleware
The npm package koa-etag receives a total of 259,535 weekly downloads. As such, koa-etag popularity was classified as popular.
We found that koa-etag demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 11 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.