Medley plugin for automatic ETag generation & conditional GET responses.
Generates an ETag header for string and Buffer response bodies and sends a 304 Not Modified response if the ETag matches the incoming If-None-Match header.
npm install @medley/etag
# or
yarn add @medley/etagconst medley = require('@medley/medley');
const app = medley();
app.register(require('@medley/etag'));
app.get('/', (req, res) => {
res.send('Hello World');
});
app.listen(3000);