diff options
author | Loïc Hoguin <[email protected]> | 2013-01-29 13:32:48 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2013-01-29 13:33:47 +0100 |
commit | b2ba4d28f8962f7c24acf7dfcfb7de936e5f6026 (patch) | |
tree | f60f90e2c92282f3c8508efca2bff42a360acd90 /guide | |
parent | bdc8342595a8f996db20717992242a5917d496e0 (diff) | |
download | cowboy-b2ba4d28f8962f7c24acf7dfcfb7de936e5f6026.tar.gz cowboy-b2ba4d28f8962f7c24acf7dfcfb7de936e5f6026.tar.bz2 cowboy-b2ba4d28f8962f7c24acf7dfcfb7de936e5f6026.zip |
Add a section about closing the connection in the guide
Diffstat (limited to 'guide')
-rw-r--r-- | guide/req.md | 15 | ||||
-rw-r--r-- | guide/toc.md | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/guide/req.md b/guide/req.md index c039658..e13d3a5 100644 --- a/guide/req.md +++ b/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 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 ----------------------------- diff --git a/guide/toc.md b/guide/toc.md index 2890172..2f8fa36 100644 --- a/guide/toc.md +++ b/guide/toc.md @@ -41,6 +41,7 @@ Cowboy User Guide * Response * Chunked response * Response preconfiguration + * Closing the connection * Reducing the memory footprint * [Hooks](hooks.md) * On request |