summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2010-05-14 12:04:58 +0000
committerIgor Sysoev <igor@sysoev.ru>2010-05-14 12:04:58 +0000
commit402b2f07c2f2fc74fcafcd0792c4d583e1ad74c4 (patch)
treeffc2079136cc040268862c6ac76b6abf7e911f0a
parent05b1a8f1e3595beab4397e25c2a6db9d832a6a97 (diff)
downloadnginx-402b2f07c2f2fc74fcafcd0792c4d583e1ad74c4.tar.gz
nginx-402b2f07c2f2fc74fcafcd0792c4d583e1ad74c4.tar.bz2
do not cache response if it has "no-store" or "private"
in "Cache-Control" header
-rw-r--r--src/http/ngx_http_upstream.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index e6bef3c04..eaf54812f 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -3023,16 +3023,18 @@ ngx_http_upstream_process_cache_control(ngx_http_request_t *r,
return NGX_OK;
}
- last = h->value.data + h->value.len;
+ p = h->value.data;
+ last = p + h->value.len;
- if (ngx_strlcasestrn(h->value.data, last, (u_char *) "no-cache", 8 - 1)
- != NULL)
+ if (ngx_strlcasestrn(p, last, (u_char *) "no-cache", 8 - 1) != NULL
+ || ngx_strlcasestrn(p, last, (u_char *) "no-store", 8 - 1) != NULL
+ || ngx_strlcasestrn(p, last, (u_char *) "private", 7 - 1) != NULL)
{
u->cacheable = 0;
return NGX_OK;
}
- p = ngx_strlcasestrn(h->value.data, last, (u_char *) "max-age=", 8 - 1);
+ p = ngx_strlcasestrn(p, last, (u_char *) "max-age=", 8 - 1);
if (p == NULL) {
return NGX_OK;