top | item 34620844

(no title)

roganartu | 3 years ago

As the post points out, Python web frameworks have historically not prioritized improving the performance of serving static files, and that seems… fine?

If we assume that all projects have a finite amount of engineering effort available, then triaging is expected. The best practice for production web applications for decades has been to serve them from behind a reverse proxy. From there, it is usually fairly trivial to use path matching to serve static files from the reverse proxy itself, a tool that is much better suited to this purpose and can easily saturate any link you throw at it without breaking a sweat.

It seems perfectly reasonable for the maintainers of these web frameworks to defer improving the performance of static file serving indefinitely given this.

discuss

order

alsadi|3 years ago

Many things have changed since the old days. In PEP 3333 sendfile is exposed as opposed to PEP 333 (so in the WSGI days they had no way of doing it, but in ASGI they can do it).

The assumption that nginx is always there no longer hold, specially in microservices, ex. Running behind haproxy (does not service static files) or running bechind cloud provides like AWS ALB.