On Fri, 25 Sep 2015 10:40:36 +0200, Sönke Ludwig wrote:

Am 25.09.2015 um 00:24 schrieb yawniek:

what is the fastest way to server a file from disk
and set custom headers such as cache control?

is it possible so that internally sendfile gets used?

On GIT master, incidentally I've made sendFile public just yesterday.
But for the time being, serveStaticFile(path)(req, res); can be used.
The only drawback is that it will to a GC allocation, even if just a
small one.

thanks. cool!

i made it work with serveStaticFile, my problem was actually a bug with libasync and i forgot that i was using that.