[mod_python] Serving files efficiently

Conrad Steenberg conrad at hep.caltech.edu
Thu May 30 22:57:05 EST 2002


Hi Dustin

Thanks! I'll try it tomorrow :-)

Conrad

On Thu, 2002-05-30 at 19:07, Dustin Mitchell wrote:
> On Thu, May 30, 2002 at 06:20:56PM -0700, Conrad Steenberg wrote:
> > Hi
> > 
> > Looking at the previous thread on serving files got me thinking:
> > 
> > I'm also trying to serve a file (or part of a file) in response to an
> > xmlrpc query. Since URL filtering etc. is not an option in this case, is
> > there a way to tell apache to do a sendfile() or similar from
> > mod_python? I'm sure this would be more efficient that my current method
> > of (roughly) reading to a buffer and then sending the buffer with
> > req.write() and constructing my own headers.
> 
> Since sendfile() is pretty much what Apache will do anyway, you can just call
> sendfile() from Python.  There's a Python implementation of sendfile in
> Medusa (I haven't tested it, but it's in the source).  You could also SWIG
> it.
> 
> http://www.nightmare.com/medusa/
> http://www.swig.org/
> 
> Dustin
> 
> -- 
> 
>   Dustin Mitchell
>   dustin at ywlcs.org
>   http://people.cs.uchicago.edu/~dustin/
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://www.modpython.org/mailman/listinfo/mod_python
-- 




More information about the Mod_python mailing list