Subscribe on changes!

etag computation is doubled

avatar
May 8th 2020

Describe the bug

The etagCacheCheck (e.g. here) function seems unnecessary as the koa-conditional-get and koa-etag middlewares already handle that scenario. Both of them are placed at the end of the pipeline and after the next() invocation.

I can provide a PR with tests for that, if needed.

System Info

  • required vite version: 0.12.0
  • required Operating System: MacOS
  • required Node version: 14.1.0

Logs

NA

Reproduction

NA

avatar
May 8th 2020

koa-etag and koa-conditional-get both will be skipped because the Vue plugin directly returns without calling next.

They will also be skipped if any upstream middleware has already set a status due to https://github.com/vuejs/vite/blob/master/src/node/server/serverPluginServeStatic.ts#L8