defsimple_app(environ,start_response):"""Simplest possible application object"""f=open(r'D:\htdocs\summary.txt')body=f.read()f.close()status='200 OK'response_headers=[('Content-type','text/plain'),('Content-Length',str(len(body)))]start_response(status,response_headers)return[body]
So we can come close. Using sendfile/TransmitFile might help.
Being a threaded server (and written in python!) CP will never play in the same ballpark as lighty or nginx for static file serving. IMHO micro-optimizations in this area would only be a waste of our precious, scarce developer ressources :)
Let's focus on CP's core competencies and improve those. Nobody in their right mind will use CP for static file serving in a production setup anyways.
personally, I find Moe's argument to be circular:
don't bother to optimize the static file performance because it's not important.
It's not important because no-one will use it in production anyways.
No-one will use it in production because it's not not close enough to lighty in performance.