| 86 | ==== [TracStandalone tracd] and HTTP/1.1 ==== |
| 87 | |
| 88 | Since 0.11.5, tracd could be used with the `--http11` flag, which would select the use of the HTTP/1.1 protocol and most notably activate Keep-Alive connections. This is now the default behavior in 0.12. |
| 89 | |
| 90 | This has some important consequences for plugins which send content directly to the client. They should take care of setting the `Content-Length` header properly, otherwise the browser will simply "hang". |
| 91 | |
| 92 | This means that any: |
| 93 | {{{ |
| 94 | #!python |
| 95 | req.write(content) |
| 96 | }}} |
| 97 | must be preceded by a: |
| 98 | {{{ |
| 99 | #!python |
| 100 | req.send_header('Content-Length', len(content)) |
| 101 | }}} |
| 102 | |
| 103 | Don't forget to do that for ''any'' data directly sent back to the client, including responses for XHRs (e.g. r8300). |
| 104 | This requires a some discipline in the coding, but the benefit is a huge performance boost for tracd, so it's well worth the price. |
| 105 | |
| 106 | See #8020 for details. |
| 107 | |