vercel / serve-handler

The foundation of `serve`

Home Page:https://npmjs.com/serve-handler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Room for micro-optimisation

ichiriac opened this issue · comments

Hi,

I'm looking for an asset oriented server. Yours seems great, not tested yet but I saw something weird in the code here : https://github.com/zeit/serve-handler/blob/master/src/index.js#L751

You could make the check before creating the readable stream, 304 will be more efficient, and by the way, you don't destroy it before returning, it may keep open a file descriptor.

Hope it helps,
BR, Ioan