<div dir="ltr"><div>Happy holidays to you all!</div><div><br></div><div>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: <a href="https://github.com/gquintard/vmod_fileserver">https://github.com/gquintard/vmod_fileserver</a></div><div><br></div><div>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.</div><div><br></div><div>Essentially, this vmod:</div><div>- allows you to set a root directory and serve files from there</div><div>- supports HEAD/GET</div><div>- supports conditional requests with if-none-match and if-modified-since<br></div><div><br></div><div>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.<br></div><div><br></div><div>Also, if you are a C developer curious about rust, you might want to look at the code: <a href="https://github.com/gquintard/vmod_fileserver/blob/main/src/lib.rs">https://github.com/gquintard/vmod_fileserver/blob/main/src/lib.rs</a></div><div>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.</div><div><br></div><div>Anyway, that's all for me, let me know what you think!</div><div><br></div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>-- <br></div><div>Guillaume Quintard<br></div></div></div></div></div></div>