]> git.kaiwu.me - njs.git/commit
Modules: added nocache flag for js_set variables.
authorThomas P. <TPXP@users.noreply.github.com>
Wed, 7 Aug 2024 09:47:08 +0000 (11:47 +0200)
committerDmitry Volyntsev <xeioexception@gmail.com>
Sat, 24 Aug 2024 00:33:20 +0000 (17:33 -0700)
commit5b7905c57fcb994a880804066c6abec32490180c
tree502ed95c4ea8faceecb06c0b0730c2444e1cbe6f
parent0d2b8b53168261d8bc2fb9ceb15244e2bccd9c70
Modules: added nocache flag for js_set variables.

This commit adds support for an additional `nocache` flag in `js_set`
directives. If set, the resulting nginx variable will have no_cacheable set
to 1. This enables us to dynamically recompute a variable if the context
changed (for example, in case of an internal redirection).

In case of multiple calls in a location, users should cache the result in a
rewrite variable: `set $cached_variable $js_variable;`
nginx/ngx_http_js_module.c
nginx/ngx_js.h
nginx/ngx_stream_js_module.c
nginx/t/js_variables_nocache.t [new file with mode: 0644]
nginx/t/stream_js_variables_nocache.t [new file with mode: 0644]