You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...and when paired with eg WhiteNoise, allows for Django static assets to be served in a fairly efficient way in environments where use of a separate nginx proxy is not possible or desired.
As such, it would be great if Granian's WSGI interface supported it too :-)
The text was updated successfully, but these errors were encountered:
As of today there's no support for sendfile(2) in tokio – and consequentially in hyper. Thus, even if Granian would provide a file_wrapper implementation, it won't have any noticeable performance benefit compared to reading the file in Python and iterate over its contents.
Note that this is also the same reason why ASGI zero copy send is marked as inapplicable in #93.
Hi!
The WSGI spec includes support for optional platform-specific file handling support via
wsgi.file_wrapper
:https://peps.python.org/pep-3333/#optional-platform-specific-file-handling
This can be used to improve performance of serving files - for example, by using
sendfile()
on Unix.This is supported by gunicorn:
https://github.com/benoitc/gunicorn/blob/bacbf8aa5152b94e44aa5d2a94aeaf0318a85248/gunicorn/http/wsgi.py#L359-L390
...and when paired with eg WhiteNoise, allows for Django static assets to be served in a fairly efficient way in environments where use of a separate nginx proxy is not possible or desired.
As such, it would be great if Granian's WSGI interface supported it too :-)
The text was updated successfully, but these errors were encountered: