Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 91 additions & 1 deletion xml/en/docs/http/ngx_http_js_module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<module name="Module ngx_http_js_module"
link="/en/docs/http/ngx_http_js_module.html"
lang="en"
rev="54">
rev="55">

<section id="summary">

Expand Down Expand Up @@ -473,6 +473,96 @@ with <link doc="../njs/reference.xml" id="ngx_fetch">Fetch API</link>.
</directive>


<directive name="js_fetch_keepalive">
<syntax><value>connections</value></syntax>
<default>0</default>
<context>http</context>
<context>server</context>
<context>location</context>

<para>
Activates the cache for connections to destination servers.
When the value is greater than <literal>0</literal>,
enables keepalive connections for
<link doc="../njs/reference.xml" id="ngx_fetch">Fetch API</link>.
</para>

<para>
The <value>connections</value> parameter sets the maximum number of idle
keepalive connections to destination servers that are preserved in the cache
of each worker process.
When this number is exceeded, the least recently used connections are closed.
</para>

<para>
Example:
<example>
location /fetch {
js_fetch_keepalive 32;
js_fetch_trusted_certificate /path/to/ISRG_Root_X1.pem;
js_content main.fetch_handler;
}
</example>
</para>

</directive>


<directive name="js_fetch_keepalive_requests">
<syntax><value>number</value></syntax>
<default>1000</default>
<context>http</context>
<context>server</context>
<context>location</context>

<para>
Sets the maximum number of requests that can be served through one keepalive
connection with <link doc="../njs/reference.xml" id="ngx_fetch">Fetch API</link>.
After the maximum number of requests is made, the connection is closed.
</para>

<para>
Closing connections periodically is necessary to free per-connection memory
allocations.
Therefore, using too high maximum number of requests could result in
excessive memory usage and not recommended.
</para>

</directive>


<directive name="js_fetch_keepalive_time">
<syntax><value>time</value></syntax>
<default>1h</default>
<context>http</context>
<context>server</context>
<context>location</context>

<para>
Limits the maximum time during which requests can be processed through one
keepalive connection with <link doc="../njs/reference.xml" id="ngx_fetch">Fetch API</link>.
After this time is reached, the connection is closed following the subsequent
request processing.
</para>

</directive>


<directive name="js_fetch_keepalive_timeout">
<syntax><value>time</value></syntax>
<default>60s</default>
<context>http</context>
<context>server</context>
<context>location</context>

<para>
Sets a timeout during which an idle keepalive connection to a destination server
will stay open with <link doc="../njs/reference.xml" id="ngx_fetch">Fetch API</link>.
</para>

</directive>


<directive name="js_header_filter">
<syntax><value>module.function</value></syntax>
<default/>
Expand Down
3 changes: 1 addition & 2 deletions xml/en/docs/njs/engine.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<article name="JavaScript Engine"
link="/en/docs/njs/engine.html"
lang="en"
rev="4"
rev="5"
toc="no">

<section>
Expand Down Expand Up @@ -60,7 +60,6 @@ to ensure compatibility with the njs engine, with the following exceptions:
<listitem>
njs-specific API:
<link doc="reference.xml" id="njs_dump"><literal>njs.dump()</literal></link>,
<link doc="reference.xml" id="njs_on"><literal>njs.on()</literal></link>,
<literal>console.dump()</literal>.
</listitem>

Expand Down
89 changes: 88 additions & 1 deletion xml/en/docs/stream/ngx_stream_js_module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<module name="Module ngx_stream_js_module"
link="/en/docs/stream/ngx_stream_js_module.html"
lang="en"
rev="50">
rev="51">

<section id="summary">

Expand Down Expand Up @@ -347,6 +347,93 @@ with <link doc="../njs/reference.xml" id="ngx_fetch">Fetch API</link>.
</directive>


<directive name="js_fetch_keepalive">
<syntax><value>connections</value></syntax>
<default>0</default>
<context>stream</context>
<context>server</context>

<para>
Activates the cache for connections to destination servers.
When the value is greater than <literal>0</literal>,
enables keepalive connections for
<link doc="../njs/reference.xml" id="ngx_fetch">Fetch API</link>.
</para>

<para>
The <value>connections</value> parameter sets the maximum number of idle
keepalive connections to destination servers that are preserved in the cache
of each worker process.
When this number is exceeded, the least recently used connections are closed.
</para>

<para>
Example:
<example>
server {
listen 12345;
js_fetch_keepalive 32;
js_fetch_trusted_certificate /path/to/ISRG_Root_X1.pem;
js_preread main.fetch_handler;
}
</example>
</para>

</directive>


<directive name="js_fetch_keepalive_requests">
<syntax><value>number</value></syntax>
<default>1000</default>
<context>stream</context>
<context>server</context>

<para>
Sets the maximum number of requests that can be served through one keepalive
connection with <link doc="../njs/reference.xml" id="ngx_fetch">Fetch API</link>.
After the maximum number of requests is made, the connection is closed.
</para>

<para>
Closing connections periodically is necessary to free per-connection memory
allocations.
Therefore, using too high maximum number of requests could result in
excessive memory usage and not recommended.
</para>

</directive>


<directive name="js_fetch_keepalive_time">
<syntax><value>time</value></syntax>
<default>1h</default>
<context>stream</context>
<context>server</context>

<para>
Limits the maximum time during which requests can be processed through one
keepalive connection with <link doc="../njs/reference.xml" id="ngx_fetch">Fetch API</link>.
After this time is reached, the connection is closed following the subsequent
request processing.
</para>

</directive>


<directive name="js_fetch_keepalive_timeout">
<syntax><value>time</value></syntax>
<default>60s</default>
<context>stream</context>
<context>server</context>

<para>
Sets a timeout during which an idle keepalive connection to a destination server
will stay open with <link doc="../njs/reference.xml" id="ngx_fetch">Fetch API</link>.
</para>

</directive>


<directive name="js_filter">
<syntax><value>module.function</value></syntax>
<default/>
Expand Down
94 changes: 93 additions & 1 deletion xml/ru/docs/http/ngx_http_js_module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<module name="Модуль ngx_http_js_module"
link="/ru/docs/http/ngx_http_js_module.html"
lang="ru"
rev="51">
rev="52">

<section id="summary">

Expand Down Expand Up @@ -450,6 +450,98 @@ HTTPS-сертификата
</directive>


<directive name="js_fetch_keepalive">
<syntax><value>соединения</value></syntax>
<default>0</default>
<context>http</context>
<context>server</context>
<context>location</context>

<para>
Активирует кэш для соединений с серверами назначения.
Если значение больше <literal>0</literal>,
включает keepalive-соединения для
<link doc="../njs/reference.xml" id="ngx_fetch">Fetch API</link>.
</para>

<para>
Параметр <value>соединения</value> задаёт максимальное количество
неактивных keepalive-соединений с серверами назначения,
которые сохраняются в кэше каждого рабочего процесса.
Если это количество превышено, наименее недавно использованные соединения закрываются.
</para>

<para>
Пример:
<example>
location /fetch {
js_fetch_keepalive 32;
js_fetch_trusted_certificate /path/to/ISRG_Root_X1.pem;
js_content main.fetch_handler;
}
</example>
</para>

</directive>


<directive name="js_fetch_keepalive_requests">
<syntax><value>число</value></syntax>
<default>1000</default>
<context>http</context>
<context>server</context>
<context>location</context>

<para>
Задаёт максимальное количество запросов, которые могут быть обслужены
через одно keepalive-соединение при помощи
<link doc="../njs/reference.xml" id="ngx_fetch">Fetch API</link>.
После выполнения максимального количества запросов соединение закрывается.
</para>

<para>
Периодическое закрытие соединений необходимо для освобождения
выделенной под соединение памяти.
Поэтому использование слишком большого максимального количества запросов
может привести к чрезмерному потреблению памяти и не рекомендуется.
</para>

</directive>


<directive name="js_fetch_keepalive_time">
<syntax><value>время</value></syntax>
<default>1h</default>
<context>http</context>
<context>server</context>
<context>location</context>

<para>
Ограничивает максимальное время, в течение которого запросы могут обрабатываться
через одно keepalive-соединение при помощи
<link doc="../njs/reference.xml" id="ngx_fetch">Fetch API</link>.
По истечении этого времени соединение закрывается после обработки очередного запроса.
</para>

</directive>


<directive name="js_fetch_keepalive_timeout">
<syntax><value>время</value></syntax>
<default>60s</default>
<context>http</context>
<context>server</context>
<context>location</context>

<para>
Задаёт таймаут, в течение которого неактивное keepalive-соединение
с сервером назначения остается открытым при помощи
<link doc="../njs/reference.xml" id="ngx_fetch">Fetch API</link>.
</para>

</directive>


<directive name="js_header_filter">
<syntax><value>функция</value> | <value>модуль.функция</value></syntax>
<default/>
Expand Down
3 changes: 1 addition & 2 deletions xml/ru/docs/njs/engine.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<article name="Движок JavaScript"
link="/ru/docs/njs/engine.html"
lang="ru"
rev="4"
rev="5"
toc="no">

<section>
Expand Down Expand Up @@ -60,7 +60,6 @@ njs &mdash; встроенный движок JavaScript,
<listitem>
API njs:
<link doc="reference.xml" id="njs_dump"><literal>njs.dump()</literal></link>,
<link doc="reference.xml" id="njs_on"><literal>njs.on()</literal></link>,
<literal>console.dump()</literal>.
</listitem>

Expand Down
Loading