aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_upstream.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/ngx_http_upstream.c')
-rw-r--r--src/http/ngx_http_upstream.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index 9a70b8c7e..df7e5f4ea 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -4160,7 +4160,17 @@ ngx_http_upstream_process_vary(ngx_http_request_t *r,
return NGX_OK;
}
- u->cacheable = 0;
+ if (r->cache == NULL) {
+ return NGX_OK;
+ }
+
+ if (h->value.len > NGX_HTTP_CACHE_VARY_LEN
+ || (h->value.len == 1 && h->value.data[0] == '*'))
+ {
+ u->cacheable = 0;
+ }
+
+ r->cache->vary = h->value;
#endif