expressjs / expressjs/express

Make express.static use the "etag" application setting

Open
#2,945 4 comments 0 reactions 0 assignees View on GitHub
5.x
Dominant language
JavaScript
Stars
69.5k
Forks
25k
Avg merge
4d 20h
Merged PRs (30d)
9

Description

I saw this feature on the 5.0 roadmap #2237 and I initially thought that it would need to be implemented in the serve-static module (https://github.com/expressjs/serve-static/pull/64). I think maybe I had misunderstood the use case as the comments I received there were that the changes needed to be made in express.

So after getting it wrong the first time I wanted to open this issue as a discussion item around the requirements for this feature and how best to implement it.

I think now the use case is this:

``` js
var express = require('express');
var app = express();
app.disable('etag');
app.use(express.static('/static')); // also disables etag without needing {'etag':false}
```

So if etags are disabled **before** express.static is called then they are also disabled for static content.

Does this make sense? Any comments appreciated.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.