-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Closed as not planned
Labels
Description
The StaticFileHandler
should use os.sendfile()
if available. While static files would commonly be sent by an external webserver (nginx etc.) in a production environment, sometimes files are generated on the fly and need to be written out through the IOLoop. sendfile()
would reduce the overhead here.
I'd also like to have a general high-level RequestHandler.send_file(file_path, content_type=None)
method for this case that the StaticFileHandler
would call, but that other user code could conveniently use as well. If sendfile()
is not available, it would simply fall back to forwarding chunks, but user code wouldn't have to care any more how exactly it works on the current system.
sedrubal and honglei