Mailing List Archive

introducing vmod_fileserver
Happy holidays to you all!

I had a few days off, so of course I decided to finally get some hacking
time on Varnish, and decided to once again spend some time on rust and
backends. Here's what I got:

As the name suggests, this vmod allows you to serve files directly from
disk, without relying on an external backend. That can be useful for a
bunch of things like returning a healthcheck file generated by another
process, providing an error page in case of backend failure, or just to
provide some test data quickly.

Essentially, this vmod:
- allows you to set a root directory and serve files from there
- supports HEAD/GET
- supports conditional requests with if-none-match and if-modified-since

The API is minimal, and the code hasn't seen any production traffic yet, so
be careful! But if you can test it and there are some use cases not covered
here, I'll happily hear your feedback.

Also, if you are a C developer curious about rust, you might want to look
at the code:
I commented it as much as I could, and because varnish-rs is far from
complete, you'll see a lot of C idiosyncrasies that aren't "hidden" by
rust, and therefore the code might look more familiar.

Anyway, that's all for me, let me know what you think!

Guillaume Quintard