SuaveIO / suave

Suave is a simple web development F# library providing a lightweight web server and a set of combinators to manipulate route flow and task composition.
https://suave.io
Other
1.32k stars 198 forks source link

Question: ETag headers for static files #770

Open njlr opened 1 year ago

njlr commented 1 year ago

Is there already a mechanism for serving files with the ETag header properly set?

Given the cost of computing the ETag (likely a hash of the file) I think this should be an opt-in feature. To amortize the cost of hashing, we may want to leverage FileSystemWatcher.

If not, happy to send a PR with a bit of design direction.

ademar commented 1 year ago

We do not have such mechanism. Certainly it would be nice if Suave had a way of generating etags, I am interested in seeing what you have in mind. :)