On Sat, Apr 10, 2010 at 15:04, Chris Dent <chris.d...@gmail.com> wrote:
> On Thu, 8 Apr 2010, P.J. Eby wrote:
>> This is also a good time for people to learn that generators are usually a
>> *very bad* way to write WSGI apps - yielding is for server push or sending
>> blocks of large files, not tiny strings.  In general, if you're yielding
>> more than one block, you're almost certainly doing WSGI wrong.  The typical
>> HTML, XML, or JSON output that's 99% of a webapp's requests should be
>> transmitted as a single string, rather than as a series of snippets.

While I agree that it doesn't make sense to yield small strings, it
seems to make perfect sense to chunk up larger buffers (e.g. starting
at several kilobytes). This is something we do when transmitting
Mercurial changesets, for example.

Cheers,

Dirkjan
_______________________________________________
Web-SIG mailing list
Web-SIG@python.org
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe: 
http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com

Reply via email to