On Fri, Feb 6, 2009 at 3:23 PM, Armin Ronacher <[email protected]> wrote: > > Hi, > > limodou wrote: >> And I checked the werkzeug source code, and there is a >> SharedDataMiddleware, I think it's great, but I can just see the code >> will only read the stream only once, and the return value is also >> [data], so I think it's not support what I want? Am I right? And if it >> doesn't support, is there a plan to support it? > I don't really have ambitions to add support for that currently. The > reason is that the SharedDataMiddleware is intended for development > mostly and there memory usage is not that much of a problem. > > Sending all at once has the advantage that we can easily generate etags > for it. If this however is a problem because you are using the shared > data middleware for huge files even in development mode you should > consider opening a ticket in the trac for it. > > Regards, > Armin >
Here is the article about how to use webob to process File download: http://pythonpaste.org/webob/file-example.html And in this article it'll use res.etag = '%s-%s-%s' % (os.path.getmtime(filename), os.path.getsize(filename), hash(filename)) to create etag, so it don't need the whole content to create etag, and for a large file, using whole content is a bad idea. I'm using webob now, and I just want to change to werkzeug, but I found this problem, so I have to stick the webob. And even for a product site, if the site is small I think using werkzeug to serving static files is not so bad. thanks. -- I like python! UliPad <<The Python Editor>>: http://code.google.com/p/ulipad/ UliWeb <<simple web framework>>: http://uliwebproject.appspot.com My Blog: (new)http://http://hi.baidu.com/limodou (old)http://www.donews.net/limodou --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pocoo-libs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/pocoo-libs?hl=en -~----------~----~----~----~------~----~------~--~---
