Sends a file to the given HTTP server response object.
When serving a file, certain request headers are supported to avoid sending
the file if the client has it already cached. These headers are
"If-None-Match". The client will be delivered
with the necessary
"Etag" (generated from the path, size and last
modification time of the file) and
The cache control directives
"Cache-Control" will also be
emitted if the
HTTPFileServerSettings field is set to a positive
Finally, HEAD requests will automatically be handled without reading the actual file contents. Am empty response body is written instead.
|req||The incoming HTTP request - cache and modification headers of the request can influence the generated response.|
|res||The response object to write to.|
|settings||Optional settings object enabling customization of how the file gets served.|
© 2012-2015 RejectedSoftware e.K.
Subject to the terms of the MIT license, as written in the included LICENSE.txt file.