mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-15 04:30:25 +00:00
Add a section about closing the connection in the guide
This commit is contained in:
parent
bdc8342595
commit
b2ba4d28f8
2 changed files with 16 additions and 0 deletions
15
guide/req.md
15
guide/req.md
|
@ -176,6 +176,21 @@ override all preset values. This means for example that you
|
||||||
can set a default body and then override it when you decide
|
can set a default body and then override it when you decide
|
||||||
to send a reply.
|
to send a reply.
|
||||||
|
|
||||||
|
Closing the connection
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
HTTP/1.1 keep-alive allows clients to send more than one request
|
||||||
|
on the same connection. This can be useful for speeding up the
|
||||||
|
loading of webpages, but is not required. You can tell Cowboy
|
||||||
|
explicitly that you want to close the connection by setting the
|
||||||
|
`Connection` header to `close`.
|
||||||
|
|
||||||
|
``` erlang
|
||||||
|
{ok, Req2} = cowboy_req:reply(200,
|
||||||
|
[{<<"connection">>, <<"close">>}],
|
||||||
|
Req).
|
||||||
|
```
|
||||||
|
|
||||||
Reducing the memory footprint
|
Reducing the memory footprint
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@ Cowboy User Guide
|
||||||
* Response
|
* Response
|
||||||
* Chunked response
|
* Chunked response
|
||||||
* Response preconfiguration
|
* Response preconfiguration
|
||||||
|
* Closing the connection
|
||||||
* Reducing the memory footprint
|
* Reducing the memory footprint
|
||||||
* [Hooks](hooks.md)
|
* [Hooks](hooks.md)
|
||||||
* On request
|
* On request
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue