[mod_python] send file back to apache?

Graham Dumpleton graham.dumpleton at gmail.com
Sun Jul 22 23:03:21 EDT 2007


When using req.sendfile() it is still mod_python that is sending the
file and so Apache doesn't necessarily get its opportunity to do its
other stuff like etag and caching etc.

BTW, I forgot in my suggestion and important thing. You need to have
mod_python 3.3 or later and must also update req.finfo. Ie.,

  req.filename = '/some/path'
  req.finfo = apache.stat(req.filename)
  return apache.DECLINED

Note, this is slightly theoretical and I haven't fully tested it. :-)

Graham

On 23/07/07, Greg Fawcett <greg at vig.co.nz> wrote:
> request.sendfile() may be what you are looking for.
>
>
> On 23/07/07, Peter Shinners <pete at shinners.org> wrote:
> > If I have the full path of a static file I want served, is there a way to
> > let apache deal with it, after entering my mod_python handler?
> >
> > I've written the Python code to try sending a static file. It deals with
> > ETag, caching, and stuff. It still seems like this would be a better task
> > for apache?
> >
> > _______________________________________________
> > Mod_python mailing list
> > Mod_python at modpython.org
> > http://mailman.modpython.org/mailman/listinfo/mod_python
> >
>
>
>
> --
> Phone: +64 3 409 8165
> Mobile: +64 21 333 291
> Fax: +64 3 974 6810
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>
>


More information about the Mod_python mailing list