c-cube / tiny_httpd

Minimal HTTP server using good old threads + blocking IO, with a small request router.
https://c-cube.github.io/tiny_httpd
76 stars 11 forks source link

Should use magic-mime (or mrmime) #53

Closed craff closed 8 months ago

craff commented 1 year ago

The call for file to get the mime type for small file is very costly.

c-cube commented 1 year ago

Hum, are you using http_of_dir for high workloads?

Since it's a small companion app to the dependency-less library, I'd rather suggest that we implement a tiny mime type cache. At least if it's based on extensions, I don't know if that's enough…

c-cube commented 8 months ago

This should not be an issue for http_of_dir for realistic use cases (serving a directory on localhost), I think. For now I prefer to keep things simple.