Skip to content

Commit d1cd405

Browse files
xeioexy82
authored andcommitted
Documented the "nocache" parameter of the "js_set" directive.
1 parent 8ede3bf commit d1cd405

File tree

4 files changed

+58
-12
lines changed

4 files changed

+58
-12
lines changed

xml/en/docs/http/ngx_http_js_module.xml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<module name="Module ngx_http_js_module"
1010
link="/en/docs/http/ngx_http_js_module.html"
1111
lang="en"
12-
rev="47">
12+
rev="48">
1313

1414
<section id="summary">
1515

@@ -646,8 +646,9 @@ Several <literal>js_preload_object</literal> directives can be specified.
646646

647647
<directive name="js_set">
648648
<syntax>
649-
<value>$variable</value> <value>function</value> |
650-
<value>module.function</value></syntax>
649+
<value>$variable</value>
650+
<value>function</value> | <value>module.function</value>
651+
[<literal>nocache</literal>]</syntax>
651652
<default/>
652653
<context>http</context>
653654
<context>server</context>
@@ -675,6 +676,17 @@ This handler can be used to do some cleanup
675676
right before the request is freed.
676677
</para>
677678

679+
<para>
680+
Since <link doc="../njs/changes.xml" id="njs0.8.6">0.8.6</link>,
681+
if an optional argument <literal>nocache</literal> is specified,
682+
the handler is called every time it is referenced.
683+
Due to current limitations
684+
of the <link doc="ngx_http_rewrite_module.xml">rewrite</link> module,
685+
when a <literal>nocache</literal> variable is referenced by the
686+
<link doc="ngx_http_rewrite_module.xml" id="set">set</link> directive
687+
its handler should always return a fixed-length value.
688+
</para>
689+
678690
<para>
679691
<note>
680692
As the <literal>js_set</literal> handler

xml/en/docs/stream/ngx_stream_js_module.xml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<module name="Module ngx_stream_js_module"
1010
link="/en/docs/stream/ngx_stream_js_module.html"
1111
lang="en"
12-
rev="45">
12+
rev="46">
1313

1414
<section id="summary">
1515

@@ -632,8 +632,9 @@ See
632632

633633
<directive name="js_set">
634634
<syntax>
635-
<value>$variable</value> <value>function</value> |
636-
<value>module.function</value></syntax>
635+
<value>$variable</value>
636+
<value>function</value> | <value>module.function</value>
637+
[<literal>nocache</literal>]</syntax>
637638
<default/>
638639
<context>stream</context>
639640
<context>server</context>
@@ -660,6 +661,17 @@ This handler can be used to do some cleanup
660661
right before the request is freed.
661662
</para>
662663

664+
<para>
665+
Since <link doc="../njs/changes.xml" id="njs0.8.6">0.8.6</link>, when
666+
optional argument <literal>nocache</literal> is provided the handler
667+
is called every time it is referenced.
668+
Due to current limitations
669+
of the <link doc="ngx_stream_rewrite_module.xml">rewrite</link> module,
670+
when a <literal>nocache</literal> variable is referenced by the
671+
<link doc="ngx_stream_set_module.xml" id="set">set</link> directive
672+
its handler should always return a fixed-length value.
673+
</para>
674+
663675
<para>
664676
<note>
665677
As the <literal>js_set</literal> handler

xml/ru/docs/http/ngx_http_js_module.xml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<module name="Модуль ngx_http_js_module"
1010
link="/ru/docs/http/ngx_http_js_module.html"
1111
lang="ru"
12-
rev="47">
12+
rev="48">
1313

1414
<section id="summary">
1515

@@ -648,8 +648,9 @@ js_preload_object map.json;
648648

649649
<directive name="js_set">
650650
<syntax>
651-
<value>$переменная</value> <value>функция</value> |
652-
<value>модуль.функция</value></syntax>
651+
<value>$переменная</value>
652+
<value>функция</value> | <value>модуль.функция</value>
653+
[<literal>nocache</literal>]</syntax>
653654
<default/>
654655
<context>http</context>
655656
<context>server</context>
@@ -677,6 +678,16 @@ js_preload_object map.json;
677678
непосредственно перед освобождением запроса.
678679
</para>
679680

681+
<para>
682+
Начиная с <link doc="../njs/changes.xml" id="njs0.8.6">0.8.6</link>,
683+
если указан необязательный параметр <literal>nocache</literal>, то
684+
обработчик выполняется каждый раз при обращении к переменной.
685+
Из-за ограничения модуля <link doc="ngx_http_rewrite_module.xml">rewrite</link>
686+
при обращении к <literal>nocache</literal>-переменной при помощи
687+
директивы <link doc="ngx_http_rewrite_module.xml" id="set">set</link>,
688+
обработчик должен возвращать значение фиксированной длины.
689+
</para>
690+
680691
<para>
681692
<note>
682693
Так как обработчик <literal>js_set</literal>

xml/ru/docs/stream/ngx_stream_js_module.xml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<module name="Модуль ngx_stream_js_module"
1010
link="/ru/docs/stream/ngx_stream_js_module.html"
1111
lang="ru"
12-
rev="45">
12+
rev="46">
1313

1414
<section id="summary">
1515

@@ -632,8 +632,9 @@ async function handler(s) {
632632

633633
<directive name="js_set">
634634
<syntax>
635-
<value>$переменная</value> <value>функция</value> |
636-
<value>модуль.функция</value></syntax>
635+
<value>$переменная</value>
636+
<value>функция</value> | <value>модуль.функция</value>
637+
[<literal>nocache</literal>]</syntax>
637638
<default/>
638639
<context>stream</context>
639640
<context>server</context>
@@ -660,6 +661,16 @@ async function handler(s) {
660661
непосредственно перед освобождением запроса.
661662
</para>
662663

664+
<para>
665+
Начиная с <link doc="../njs/changes.xml" id="njs0.8.6">0.8.6</link>,
666+
если указан необязательный параметр <literal>nocache</literal>, то
667+
обработчик выполняется каждый раз при обращении к переменной.
668+
Из-за ограничения модуля <link doc="ngx_stream_rewrite_module.xml">rewrite</link>
669+
при обращении к <literal>nocache</literal>-переменной при помощи
670+
директивы <link doc="ngx_stream_rewrite_module.xml" id="set">set</link>,
671+
обработчик должен возвращать значение фиксированной длины.
672+
</para>
673+
663674
<para>
664675
<note>
665676
Так как обработчик <literal>js_set</literal>

0 commit comments

Comments
 (0)