Mercurial > hg > nginx-site
comparison xml/en/docs/http/ngx_http_memcached_module.xml @ 966:95c3c3bbf1ce
Text review.
author | Egor Nikitin <yegor.nikitin@gmail.com> |
---|---|
date | Wed, 14 Aug 2013 12:03:41 +0400 |
parents | ba3d6ade3513 |
children | 1501e5848052 |
comparison
equal
deleted
inserted
replaced
965:fadccc156188 | 966:95c3c3bbf1ce |
---|---|
13 rev="6"> | 13 rev="6"> |
14 | 14 |
15 <section id="summary"> | 15 <section id="summary"> |
16 | 16 |
17 <para> | 17 <para> |
18 The <literal>ngx_http_memcached_module</literal> module allows to obtain | 18 The <literal>ngx_http_memcached_module</literal> module is used to obtain |
19 responses from a memcached server. | 19 responses from a memcached server. |
20 The key is set in the <var>$memcached_key</var> variable. | 20 The key is set in the <var>$memcached_key</var> variable. |
21 A response should be put in memcached in advance via means that are | 21 A response should be put in memcached in advance by means |
22 external to nginx. | 22 external to nginx. |
23 </para> | 23 </para> |
24 | 24 |
25 </section> | 25 </section> |
26 | 26 |
55 <context>server</context> | 55 <context>server</context> |
56 <context>location</context> | 56 <context>location</context> |
57 <appeared-in>0.8.22</appeared-in> | 57 <appeared-in>0.8.22</appeared-in> |
58 | 58 |
59 <para> | 59 <para> |
60 Forces outgoing connections to a memcached server to originate | 60 Makes outgoing connections to a memcached server originate |
61 from the specified local IP <value>address</value>. | 61 from the specified local IP <value>address</value>. |
62 Value of the parameter can contain variables (1.3.12). | 62 Parameter value can contain variables (1.3.12). |
63 The special value <literal>off</literal> (1.3.12) cancels the effect | 63 The special value <literal>off</literal> (1.3.12) cancels the effect |
64 of the <literal>memcached_bind</literal> directive | 64 of the <literal>memcached_bind</literal> directive |
65 inherited from the previous configuration level, allowing the | 65 inherited from the previous configuration level, which allows the |
66 system to auto-assign local address. | 66 system to auto-assign the local IP address. |
67 </para> | 67 </para> |
68 | 68 |
69 </directive> | 69 </directive> |
70 | 70 |
71 | 71 |
75 <context>http</context> | 75 <context>http</context> |
76 <context>server</context> | 76 <context>server</context> |
77 <context>location</context> | 77 <context>location</context> |
78 | 78 |
79 <para> | 79 <para> |
80 Sets <value>size</value> of the buffer used for reading a response | 80 Sets the <value>size</value> of the buffer used for reading a response |
81 received from the memcached server. | 81 received from the memcached server. |
82 A response is passed to a client synchronously, immediately as it is received. | 82 A response is passed to a client synchronously, as soon as it is received. |
83 </para> | 83 </para> |
84 | 84 |
85 </directive> | 85 </directive> |
86 | 86 |
87 | 87 |
91 <context>http</context> | 91 <context>http</context> |
92 <context>server</context> | 92 <context>server</context> |
93 <context>location</context> | 93 <context>location</context> |
94 | 94 |
95 <para> | 95 <para> |
96 Defines a timeout for establishing a connection with the memcached server. | 96 Defines a timeout for establishing a connection with a memcached server. |
97 It should be noted that this timeout cannot usually exceed 75 seconds. | 97 It should be noted that this timeout cannot usually exceed 75 seconds. |
98 </para> | 98 </para> |
99 | 99 |
100 </directive> | 100 </directive> |
101 | 101 |
108 <context>location</context> | 108 <context>location</context> |
109 <appeared-in>1.3.6</appeared-in> | 109 <appeared-in>1.3.6</appeared-in> |
110 | 110 |
111 <para> | 111 <para> |
112 Enables the test for the <value>flag</value> presence in the memcached | 112 Enables the test for the <value>flag</value> presence in the memcached |
113 server response and sets the response header field | 113 server response and sets the “<literal>Content-Encoding</literal>” |
114 “<literal>Content-Encoding</literal>” to “<literal>gzip</literal>” | 114 response header field to “<literal>gzip</literal>” |
115 if the flag is set. | 115 if the flag is set. |
116 </para> | 116 </para> |
117 | 117 |
118 </directive> | 118 </directive> |
119 | 119 |
135 Specifies in which cases a request should be passed to the next server: | 135 Specifies in which cases a request should be passed to the next server: |
136 <list type="tag"> | 136 <list type="tag"> |
137 | 137 |
138 <tag-name><literal>error</literal></tag-name> | 138 <tag-name><literal>error</literal></tag-name> |
139 <tag-desc>an error occurred while establishing a connection with the | 139 <tag-desc>an error occurred while establishing a connection with the |
140 server, passing it a request, or reading the response header;</tag-desc> | 140 server, passing a request to it, or reading the response header;</tag-desc> |
141 | 141 |
142 <tag-name><literal>timeout</literal></tag-name> | 142 <tag-name><literal>timeout</literal></tag-name> |
143 <tag-desc>a timeout has occurred while establishing a connection with the | 143 <tag-desc>a timeout has occurred while establishing a connection with the |
144 server, passing it a request, or reading the response header;</tag-desc> | 144 server, passing a request to it, or reading the response header;</tag-desc> |
145 | 145 |
146 <tag-name><literal>invalid_response</literal></tag-name> | 146 <tag-name><literal>invalid_response</literal></tag-name> |
147 <tag-desc>a server returned empty or invalid response;</tag-desc> | 147 <tag-desc>a server returned an empty or invalid response;</tag-desc> |
148 | 148 |
149 <tag-name><literal>not_found</literal></tag-name> | 149 <tag-name><literal>not_found</literal></tag-name> |
150 <tag-desc>a response was not found on the server;</tag-desc> | 150 <tag-desc>a response was not found on the server;</tag-desc> |
151 | 151 |
152 <tag-name><literal>off</literal></tag-name> | 152 <tag-name><literal>off</literal></tag-name> |
154 | 154 |
155 </list> | 155 </list> |
156 </para> | 156 </para> |
157 | 157 |
158 <para> | 158 <para> |
159 It should be understood that passing a request to the next server is | 159 One should bear in mind that passing a request to the next server is |
160 only possible if a client was not sent anything yet. | 160 only possible if nothing has been sent to a client yet. |
161 That is, if an error or a timeout occurs in the middle of | 161 That is, if an error or timeout occurs in the middle of the |
162 transferring a response, fixing this is impossible. | 162 transferring of a response, fixing this is impossible. |
163 </para> | 163 </para> |
164 | 164 |
165 <para> | 165 <para> |
166 The directive also defines what is considered an unsuccessful attempt | 166 The directive also defines what is considered an unsuccessful attempt |
167 of communication with a | 167 of communication with a |
181 <default/> | 181 <default/> |
182 <context>location</context> | 182 <context>location</context> |
183 <context>if in location</context> | 183 <context>if in location</context> |
184 | 184 |
185 <para> | 185 <para> |
186 Sets an address of the memcached server. | 186 Sets the memcached server address. |
187 An address can be specified as a domain name or an address, and a port, | 187 The address can be specified as a domain name or an address, and a port: |
188 for example, | |
189 <example> | 188 <example> |
190 memcached_pass localhost:11211; | 189 memcached_pass localhost:11211; |
191 </example> | 190 </example> |
192 or as a UNIX-domain socket path: | 191 or as a UNIX-domain socket path: |
193 <example> | 192 <example> |
212 <context>server</context> | 211 <context>server</context> |
213 <context>location</context> | 212 <context>location</context> |
214 | 213 |
215 <para> | 214 <para> |
216 Defines a timeout for reading a response from the memcached server. | 215 Defines a timeout for reading a response from the memcached server. |
217 A timeout is only set between two successive read operations, | 216 A timeout is set only between two successive read operations, |
218 not for the transmission of the whole response. | 217 not for the transmission of the whole response. |
219 If a memcached server does not transmit anything within this time, | 218 If a memcached server does not transmit anything within this time, |
220 a connection is closed. | 219 the connection is closed. |
221 </para> | 220 </para> |
222 | 221 |
223 </directive> | 222 </directive> |
224 | 223 |
225 | 224 |
230 <context>server</context> | 229 <context>server</context> |
231 <context>location</context> | 230 <context>location</context> |
232 | 231 |
233 <para> | 232 <para> |
234 Sets a timeout for transmitting a request to the memcached server. | 233 Sets a timeout for transmitting a request to the memcached server. |
235 A timeout is only set between two successive write operations, | 234 A timeout is set only between two successive write operations, |
236 not for the transmission of the whole request. | 235 not for the transmission of the whole request. |
237 If a memcached server does not receive anything within this time, | 236 If a memcached server does not receive anything within this time, |
238 a connection is closed. | 237 a connection is closed. |
239 </para> | 238 </para> |
240 | 239 |