Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling etag after express.configure doesn't work #2317

Closed
analytically opened this issue Aug 22, 2014 · 7 comments
Closed

Disabling etag after express.configure doesn't work #2317

analytically opened this issue Aug 22, 2014 · 7 comments

Comments

@analytically
Copy link

The function in utils doesn't unset upon false.

@dougwilson
Copy link
Contributor

Yes, it does work. The utils function doesn't do any setting; it in fact returns undefined upon false instead of a function. This is how it is designed. Please provide use-land code that shows that disabling the etag after configure does not work, please.

There are tests that show it works and I tried it out and it worked just fine. So far it seems like you are just coming to a conclusion from reading the code, rather than reporting an actual bug (remember, false makes compileETag return undefined instead of a function, which is used to indicate no etags are to be generated to the rest of the express code base).

@analytically
Copy link
Author

I can assure you it's not from just reading the code. Here is our debug log:

  express:application compile etag weak +0ms
  express:application compile query parser extended +0ms
  express:application compile trust proxy false +0ms
  express:application booting in development mode +0ms
  express:router use / query +2ms
  express:router:layer new / +0ms
  express:router use / expressInit +0ms
  express:router:layer new / +0ms
  express:router:route new /ping +1ms
  express:router:layer new /ping +0ms
  express:router:route get /ping +0ms
  express:router:layer new / +0ms
  express:application compile etag false +0ms
...

So you can see etag is first enabled, than disabled. But when we now access any routes, I'm still getting an etag header.

@dougwilson
Copy link
Contributor

OK. Can you please provide me code that demonstrates the issue?

@analytically
Copy link
Author

I've moved the app.disable 'etag' statement right after express() but still the same:

  express:application compile etag weak +0ms
  express:application compile query parser extended +0ms
  express:application compile trust proxy false +0ms
  express:application booting in development mode +0ms
  express:application compile etag false +0ms

And still seeing etags. I'll see if I can put together an app.

@dougwilson
Copy link
Contributor

Yes, but what is sending the response with the ETags? Are they from res.send, res.sendfile, res.sendFile, res.download`, some other middleware, etc.?

@analytically
Copy link
Author

Found it, needed to add etag: false to express.static().

@analytically
Copy link
Author

The dynamic routes had etag disabled earlier. Sorry for the spam, and thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants