I keep seeing references for keep-alive
as a way to help maintain persistent connection, but I can't find any information on how to implement this with Django. How can I access this setting for Django? Thanks.
Asked
Active
Viewed 7,151 times
1 Answers
5
As described in this question: Keeping connection open in Django without websockets Django doesn't support this keep-alive
header as it is mostly a request/response framework. However, unlike that question you don't mention not wanting to use websockets, so...
Websockets would be the way to have a persistent connection and there is a really nice library which adds this functionality to Django called Django Channels. Using this you can establish a persistent connection to the client and send data to the client without it constantly having to request new information. There's a great tutorial in the documentation and general research on websockets should yield some useful information as well.

Don
- 3,987
- 15
- 32