diff options
author | Zhidao HONG <z.hong@f5.com> | 2023-05-25 00:27:55 +0800 |
---|---|---|
committer | Zhidao HONG <z.hong@f5.com> | 2023-05-25 00:27:55 +0800 |
commit | a378f6aa3136ed7ef172b71add31ee62e560df00 (patch) | |
tree | 701fc0e0d348a7f08cf37ed1d43cbef1e0e9d909 /src/nxt_var.h | |
parent | ce2405ec3dd97e8bdf8f63312e3c6ce59ef562d4 (diff) | |
download | unit-a378f6aa3136ed7ef172b71add31ee62e560df00.tar.gz unit-a378f6aa3136ed7ef172b71add31ee62e560df00.tar.bz2 |
HTTP: fixed variable caching.
When a variable is accessed in the Unit configuration, the value is cached.
This was useful prior to the URI rewrite feature, but now that the URI (more
precisely, the request target) can be rewritten, the contents of the variable
$uri (which contains the path part of the request target, and is decoded)
should not be cached anymore, or at least the cached value should be invalidated
after a URI rewrite.
Example:
{
"rewrite": "/prefix$uri",
"share": "$uri"
}
For a request line like GET /foo?bar=baz HTTP/1.1\r\n, the expected file
served in the response would be /prefix/foo, but due to the caching issue,
Unit currently serves /foo.
Diffstat (limited to 'src/nxt_var.h')
-rw-r--r-- | src/nxt_var.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/nxt_var.h b/src/nxt_var.h index ab25800d..d3da26eb 100644 --- a/src/nxt_var.h +++ b/src/nxt_var.h @@ -22,6 +22,7 @@ typedef struct { nxt_var_handler_t handler; nxt_var_field_hash_t field_hash; uint32_t index; + uint8_t cacheable; /* 1 bit */ } nxt_var_decl_t; |