|
9 | 9 | <module name="Module ngx_http_js_module"
|
10 | 10 | link="/en/docs/http/ngx_http_js_module.html"
|
11 | 11 | lang="en"
|
12 |
| - rev="54"> |
| 12 | + rev="55"> |
13 | 13 |
|
14 | 14 | <section id="summary">
|
15 | 15 |
|
@@ -473,6 +473,96 @@ with <link doc="../njs/reference.xml" id="ngx_fetch">Fetch API</link>.
|
473 | 473 | </directive>
|
474 | 474 |
|
475 | 475 |
|
| 476 | +<directive name="js_fetch_keepalive"> |
| 477 | +<syntax><value>connections</value></syntax> |
| 478 | +<default>0</default> |
| 479 | +<context>http</context> |
| 480 | +<context>server</context> |
| 481 | +<context>location</context> |
| 482 | + |
| 483 | +<para> |
| 484 | +Activates the cache for connections to destination servers. |
| 485 | +When the value is greater than <literal>0</literal>, |
| 486 | +enables keepalive connections for |
| 487 | +<link doc="../njs/reference.xml" id="ngx_fetch">Fetch API</link>. |
| 488 | +</para> |
| 489 | + |
| 490 | +<para> |
| 491 | +The <value>connections</value> parameter sets the maximum number of idle |
| 492 | +keepalive connections to destination servers that are preserved in the cache |
| 493 | +of each worker process. |
| 494 | +When this number is exceeded, the least recently used connections are closed. |
| 495 | +</para> |
| 496 | + |
| 497 | +<para> |
| 498 | +Example: |
| 499 | +<example> |
| 500 | +location /fetch { |
| 501 | + js_fetch_keepalive 32; |
| 502 | + js_fetch_trusted_certificate /path/to/ISRG_Root_X1.pem; |
| 503 | + js_content main.fetch_handler; |
| 504 | +} |
| 505 | +</example> |
| 506 | +</para> |
| 507 | + |
| 508 | +</directive> |
| 509 | + |
| 510 | + |
| 511 | +<directive name="js_fetch_keepalive_requests"> |
| 512 | +<syntax><value>number</value></syntax> |
| 513 | +<default>1000</default> |
| 514 | +<context>http</context> |
| 515 | +<context>server</context> |
| 516 | +<context>location</context> |
| 517 | + |
| 518 | +<para> |
| 519 | +Sets the maximum number of requests that can be served through one keepalive |
| 520 | +connection with <link doc="../njs/reference.xml" id="ngx_fetch">Fetch API</link>. |
| 521 | +After the maximum number of requests is made, the connection is closed. |
| 522 | +</para> |
| 523 | + |
| 524 | +<para> |
| 525 | +Closing connections periodically is necessary to free per-connection memory |
| 526 | +allocations. |
| 527 | +Therefore, using too high maximum number of requests could result in |
| 528 | +excessive memory usage and not recommended. |
| 529 | +</para> |
| 530 | + |
| 531 | +</directive> |
| 532 | + |
| 533 | + |
| 534 | +<directive name="js_fetch_keepalive_time"> |
| 535 | +<syntax><value>time</value></syntax> |
| 536 | +<default>1h</default> |
| 537 | +<context>http</context> |
| 538 | +<context>server</context> |
| 539 | +<context>location</context> |
| 540 | + |
| 541 | +<para> |
| 542 | +Limits the maximum time during which requests can be processed through one |
| 543 | +keepalive connection with <link doc="../njs/reference.xml" id="ngx_fetch">Fetch API</link>. |
| 544 | +After this time is reached, the connection is closed following the subsequent |
| 545 | +request processing. |
| 546 | +</para> |
| 547 | + |
| 548 | +</directive> |
| 549 | + |
| 550 | + |
| 551 | +<directive name="js_fetch_keepalive_timeout"> |
| 552 | +<syntax><value>time</value></syntax> |
| 553 | +<default>60s</default> |
| 554 | +<context>http</context> |
| 555 | +<context>server</context> |
| 556 | +<context>location</context> |
| 557 | + |
| 558 | +<para> |
| 559 | +Sets a timeout during which an idle keepalive connection to a destination server |
| 560 | +will stay open with <link doc="../njs/reference.xml" id="ngx_fetch">Fetch API</link>. |
| 561 | +</para> |
| 562 | + |
| 563 | +</directive> |
| 564 | + |
| 565 | + |
476 | 566 | <directive name="js_header_filter">
|
477 | 567 | <syntax><value>module.function</value></syntax>
|
478 | 568 | <default/>
|
|
0 commit comments