Network.Wai.Middleware.StreamFile

wai-extra-3.0.16.1: Provides some basic WAI handlers and middleware.

Safe Haskell | None
Language | Haskell2010

Network.Wai.Middleware.StreamFile

Description

Since 3.0.4

Synopsis

- streamFile :: Middleware

# Documentation

streamFile :: Middleware #

Convert ResponseFile type responses into ResponseStream type

Checks the response type, and if it's a ResponseFile, converts it into a ResponseStream. Other response types are passed through unchanged.

Converted responses get a Content-Length header.

Streaming a file will bypass a sendfile system call, and may be useful to work around systems without working sendfile implementations.

Since 3.0.4