HttpMemcachedModule
Contents |
[edit] Synopsis
You can use this module to perform simple caching.
server { location / { set $memcached_key $uri; memcached_pass name:11211; default_type text/html; error_page 404 @fallback; } location @fallback { proxy_pass backend; } }
[edit] Directives
[edit] memcached_pass
syntax: memcached_pass [ name:port ]
default: none
context: http, server, location
The backend should set the data in memcached. The memcached key is "/uri?args".
Since 0.5.9 the memcached key is now in $memcached_key.
[edit] memcached_connect_timeout
syntax: memcached_connect_timeout [ time ]
default: 60s
context: http, server, location
The timeout for connecting to memcached.
[edit] memcached_read_timeout
syntax: memcached_read_timeout [ time ]
default: 60s
context: http, server, location
The timeout for reading from memcached.
[edit] memcached_send_timeout
syntax: memcached_send_timeout [ time ]
default: 60s
context: http, server, location
The timeout for sending to memcached.
[edit] memcached_buffer_size
syntax: memcached_buffer_size [ size ]
default: see getpagesize(2)
context: http, server, location
The recv/send buffer size, in bytes.
[edit] memcached_next_upstream
syntax: memcached_next_upstream [ error | timeout | invalid_response | not_found | off ]
default: error timeout
context: http, server, location
Which failure conditions should cause the request to be forwarded to another upstream server? Applies only when the value in memcached_pass is an upstream with two or more servers.
[edit] Variables
[edit] $memcached_key
The value of the memcached key.
[edit] References
[1] Speeding up your nginx server with memcached
[edit] See Also
- The 3rd-party memc module that supports almost the whole memcached TCP protocol.









