comparison xml/en/docs/http/ngx_http_keyval_module.xml @ 2443:9d4b00f3ad2b

Improved description of keyval types.
author Yaroslav Zhuravlev <yar@nginx.com>
date Tue, 15 Oct 2019 17:46:43 +0300
parents dd3ac7eefeed
children 253641e268a8
comparison
equal deleted inserted replaced
2442:437350febcb7 2443:9d4b00f3ad2b
7 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> 7 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
8 8
9 <module name="Module ngx_http_keyval_module" 9 <module name="Module ngx_http_keyval_module"
10 link="/en/docs/http/ngx_http_keyval_module.html" 10 link="/en/docs/http/ngx_http_keyval_module.html"
11 lang="en" 11 lang="en"
12 rev="5"> 12 rev="6">
13 13
14 <section id="summary"> 14 <section id="summary">
15 15
16 <para> 16 <para>
17 The <literal>ngx_http_keyval_module</literal> module (1.13.3) creates variables 17 The <literal>ngx_http_keyval_module</literal> module (1.13.3) creates variables
67 67
68 <para> 68 <para>
69 Creates a new <value>$variable</value> whose value 69 Creates a new <value>$variable</value> whose value
70 is looked up by the <value>key</value> in the key-value database. 70 is looked up by the <value>key</value> in the key-value database.
71 Strings are matched ignoring the case. 71 Strings are matched ignoring the case.
72 Matching rules are defined by the
73 <link id="keyval_type"><literal>type</literal></link> parameter of the
74 <link id="keyval_zone"><literal>keyval_zone</literal></link> directive.
72 The database is stored in a shared memory zone 75 The database is stored in a shared memory zone
73 specified by the <literal>zone</literal> parameter. 76 specified by the <literal>zone</literal> parameter.
74 </para> 77 </para>
75 78
76 </directive> 79 </directive>
103 The optional <literal>timeout</literal> parameter (1.15.0) sets 106 The optional <literal>timeout</literal> parameter (1.15.0) sets
104 the time after which key-value pairs are removed from the zone. 107 the time after which key-value pairs are removed from the zone.
105 </para> 108 </para>
106 109
107 <para id="keyval_type"> 110 <para id="keyval_type">
108 The optional <literal>type</literal> parameter (1.17.1) specifies 111 The optional <literal>type</literal> parameter (1.17.1) activates
109 the type of the key: 112 an extra index optimized for matching the key of a certain type
110 a <literal>string</literal> (default) or <literal>ip</literal>. 113 and defines matching rules when evaluating
111 For the <literal>ip</literal> type, 114 a <link id="keyval">keyval</link> <literal>$variable</literal>.
112 the key must be the textual representation of an IP address 115 <note>
113 specified in CIDR notation. 116 The index is stored in the same shared memory zone
114 In this case, 117 and thus requires additional storage.
115 an additional index optimized for matching IP addresses and networks is used 118 </note>
116 in evaluating a variable. 119
120 <list type="tag">
121
122 <tag-name id="keyval_type_string"><literal>type=string</literal></tag-name>
123 <tag-desc>
124 default, no index is enabled;
125 variable lookup is performed using exact match
126 of the record key and a search key
127 </tag-desc>
128
129 <tag-name id="keyval_type_ip"><literal>type=ip</literal></tag-name>
130 <tag-desc>
131 the search key is the textual representation of IPv4 or IPv6 address
132 or CIDR range;
133 to match a record key, the search key must belong to a subnet
134 specified by a record key or exactly match an IP address
135 </tag-desc>
136
137 </list>
117 </para> 138 </para>
118 139
119 <para id="keyval_sync"> 140 <para id="keyval_sync">
120 The optional <literal>sync</literal> parameter (1.15.0) enables 141 The optional <literal>sync</literal> parameter (1.15.0) enables
121 <link doc="../stream/ngx_stream_zone_sync_module.xml" id="zone_sync">synchronization</link> 142 <link doc="../stream/ngx_stream_zone_sync_module.xml" id="zone_sync">synchronization</link>