Sends files from disk with ETags and byte ranges, streamed a chunk at a time. The files and thumbnails routes call it, and lib/upload.ts for the other uploads.

Functions

f
serveFile(
ctx: Context,
path: string,
unnamed 2: ServeFileOptions
): Promise<boolean>

Sends a file from disk with an ETag, answering 304 when the client already has it, and single byte ranges when ranges is set. It returns false, having sent nothing, when the file doesn't exist, and leaves the 404 to the caller.

Interfaces

I
ServeFileOptions

Passed to serveFile by its caller, which knows the file's type and how long it may be cached.