Skip to content

Commit af82f75

Browse files
kapoueragentzh
authored andcommitted
doc: documented the tip to make memcached store objects bigger than 1MB.
Signed-off-by: Yichun Zhang (agentzh) <agentzh@gmail.com>
1 parent 9d45407 commit af82f75

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

README.markdown

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Name
88
Table of Contents
99
=================
1010

11+
* [Name](#name)
1112
* [Status](#status)
1213
* [Version](#version)
1314
* [Synopsis](#synopsis)
@@ -261,7 +262,7 @@ where we define a connection pool which holds up to 10 keep-alive connections (p
261262
Caching with Redis
262263
------------------
263264

264-
One annoyance with Memcached backed caching is Memcached server's 1 MB value size limit. So it is often desired to use some more permissive backend storage services like Redis to serve as this module's backend.
265+
Redis is an alternative key-value store with many additional features.
265266

266267
Here is a working example by using Redis:
267268

@@ -494,7 +495,7 @@ srcache_store_max_size
494495

495496
When the response body length is exceeding this size, this module will not try to store the response body into the cache using the subrequest template that is specified in [srcache_store](#srcache_store).
496497

497-
This is particular useful when using cache storage backend that does have a hard upper limit on the input data. For example, for Memcached server, the limit is usually `1 MB`.
498+
This is particular useful when using a cache storage backend that does have a hard upper limit on the input data. For example, the Memcached server has a default limit of `1 MB` by item.
498499

499500
When `0` is specified (the default value), there's no limit check at all.
500501

@@ -991,6 +992,8 @@ Several common pitfalls for beginners:
991992
* The original response carries a `Cache-Control` header that explicitly disables caching and you do not configure directives like [srcache_response_cache_control](#srcache_response_cache_control).
992993
* The original response is already gzip compressed, which is not cached by default (see [srcache_ignore_content_encoding](#srcache_ignore_content_encoding)).
993994
* Memcached might return `CLIENT_ERROR bad command line format` when using a too long key (250 chars as of version 1.4.25). It is thus safer to use `set_md5 $key $uri$args;` instead of `set $key $uri$args;`. The `set_md5` directive (and more) is available from [OpenResty's set-misc module](https://github.com/openresty/set-misc-nginx-module).
995+
* Nginx might return `client intended to send too large body` when trying to store objects larger than 1m to the storage backend, in which case nginx `client_max_body_size` must be set to a higher value.
996+
* Memcached might fail to store objects larger than 1m, causing errors like `srcache_store subrequest failed status=502`. Since version 1.4.2, memcached supports a command-line `-I` option to override the default size of each slab page. Please read its manpage for more information.
994997

995998
[Back to TOC](#table-of-contents)
996999

@@ -1146,3 +1149,5 @@ See Also
11461149
* [set-misc-nginx-module](https://github.com/openresty/set-misc-nginx-module)
11471150
* The [openresty bundle](http://openresty.org)
11481151

1152+
[Back to TOC](#table-of-contents)
1153+

0 commit comments

Comments
 (0)