Cherokee Web Server: File sending

File sending

The only purpose of the file handler is to send files. No more, no less.

Parameters

The file handler accepts one parameter:

Examples

Let imagine your DocumentRoot points to /var/www.

Directory /images {
    Handler file
}

This configuration will make Cherokee to serve files inside /var/www/images like files.


You could also define another DocumentRoot for a certain directory entry.
The next configuration example is very common in Mailman installations:

Directory /images/mailman {
    Handler file
    DocumentRoot /usr/share/images/mailman/
}

On http://www.example.com/images/mailman/mailman.jpg request it will send: /usr/share/images/mailman/mailman.jpg


It is a good idea to disable to I/O cache if the content of the directory changes often:

Directory /webcam {
    Handler file {
        IOCache off
    }
}