djangorestframework and keep-alive

738 views
Skip to first unread message

Joshua Pokotilow

unread,
Nov 28, 2012, 12:01:52 PM11/28/12
to django-res...@googlegroups.com
It looks like the recommended approach for hosting a standard Django-based website is to disable keep-alive ( http://www.djangobook.com/en/2.0/chapter12.html#turn-off-keep-alive ). Since REST may necessitate sending a whole slew of HTTP requests to read and / or write hierarchical entities, it probably makes sense to leave keep-alive ON for DRF-based sites.

Agreed? And is this documented anywhere?


Jani Tiainen

unread,
Nov 28, 2012, 3:49:24 PM11/28/12
to django-res...@googlegroups.com
Note that Djangobook is _very_ old (targeted for Django 1.0) and may not contain current best practices. There is some kind of plans to update Djangobook to match 1.4 and 1.5 but it might not happen very soon.


On Wed, Nov 28, 2012 at 7:01 PM, Joshua Pokotilow <jpoko...@gmail.com> wrote:
It looks like the recommended approach for hosting a standard Django-based website is to disable keep-alive ( http://www.djangobook.com/en/2.0/chapter12.html#turn-off-keep-alive ). Since REST may necessitate sending a whole slew of HTTP requests to read and / or write hierarchical entities, it probably makes sense to leave keep-alive ON for DRF-based sites.

Agreed? And is this documented anywhere?





--
Jani Tiainen

- Well planned is half done, and a half done has been sufficient before...

Joshua Pokotilow

unread,
Nov 28, 2012, 4:04:55 PM11/28/12
to django-res...@googlegroups.com
Good to know, although the rationale for discouraging keep-alive seems sound. After all, if a browser only needs to send one request to a Django server to fetch HTML, then there's no sane reason to leave keep-alive enabled.

Mike Trienis

unread,
May 15, 2016, 9:31:08 PM5/15/16
to Django REST framework
Hey Joshua,

I'm also interested to understanding if there are concerns with using Keep-Alive ON for a REST api built with Django.

Do you ever managed to get to the bottom of this issue?

Thanks, Mike. 
Reply all
Reply to author
Forward
0 new messages