Configuration#
The package reads its configuration from environment variables, once per process, when a cached function is first called. It has no control panel and no registry records. Changing a variable requires restarting the instance.
An unset or empty variable takes its default.
An invalid value raises ValueError, naming the variable, and the instance does not start.
Environment variables#
Variable |
Default |
Accepts |
|---|---|---|
|
unset |
A URL with the scheme |
|
|
Text without spaces. Every key starts with it. |
|
|
An integer of at least 1, in seconds. The lifetime of a value in Redis. |
|
|
A number of at least 0.001, in seconds. The connect and read timeout. |
|
|
A number of at least 0, in seconds. How long an instance leaves Redis alone after a failure. |
|
|
An integer of at least 1, in bytes. Larger serialized values stay in RAM. |
|
empty |
Comma-separated |
|
empty |
Comma-separated |
The test suite parses this table and compares it with the code.
Keys#
Each value is stored under a key made of three parts, separated by colons:
<prefix>:<function>:<hash>
prefixREDIS_MEMOIZE_PREFIX.functionThe dotted name of the cached function, such as
plone.app.layout.sitemap.sitemap.generate.hashThe SHA-1 of the key
plone.memoizecomputed for the call.