[web-devel] Yesod static file approach

Michael Snoyman michael at snoyman.com
Thu Jun 16 20:41:21 CEST 2011

Hi all,

OK, I think we've gotten some good ideas, I'd like to make some
concrete proposals based on everyone's input:

* Warp should be modified to perform the stat() system call to get the
content-length when none is provided.
* In order to avoid the system call twice, we will pass the
content-length (wherever it comes from) to simple-sendfile.
* wai-app-static and yesod-static are being updated to support
embedded files. It's unclear if that will be a speed gain versus
filesystem serving, because:
    * Filesystem serving gets to use sendfile, which skips a memory
copy from user space to kernel space
    * On the other hand, embedded serving avoids touching the hard drive...
    * But the file may be cached
* (Not yet discussed): In addition to sendFile, let's provide a
sendEmbeddedFile function
* And let's make sure all this information is reflected in the docs.

Any thoughts?


More information about the web-devel mailing list