comparison src/http/ngx_http_upstream.c @ 3517:a4ee4a075ac5

do not cache response if it has "no-store" or "private" in "Cache-Control" header
author Igor Sysoev <igor@sysoev.ru>
date Fri, 14 May 2010 12:04:58 +0000
parents dd1570b6f237
children 62a4fd1e6e2c
comparison
equal deleted inserted replaced
3516:dd1570b6f237 3517:a4ee4a075ac5
3021 3021
3022 if (r->cache->valid_sec != 0) { 3022 if (r->cache->valid_sec != 0) {
3023 return NGX_OK; 3023 return NGX_OK;
3024 } 3024 }
3025 3025
3026 last = h->value.data + h->value.len; 3026 p = h->value.data;
3027 3027 last = p + h->value.len;
3028 if (ngx_strlcasestrn(h->value.data, last, (u_char *) "no-cache", 8 - 1) 3028
3029 != NULL) 3029 if (ngx_strlcasestrn(p, last, (u_char *) "no-cache", 8 - 1) != NULL
3030 || ngx_strlcasestrn(p, last, (u_char *) "no-store", 8 - 1) != NULL
3031 || ngx_strlcasestrn(p, last, (u_char *) "private", 7 - 1) != NULL)
3030 { 3032 {
3031 u->cacheable = 0; 3033 u->cacheable = 0;
3032 return NGX_OK; 3034 return NGX_OK;
3033 } 3035 }
3034 3036
3035 p = ngx_strlcasestrn(h->value.data, last, (u_char *) "max-age=", 8 - 1); 3037 p = ngx_strlcasestrn(p, last, (u_char *) "max-age=", 8 - 1);
3036 3038
3037 if (p == NULL) { 3039 if (p == NULL) {
3038 return NGX_OK; 3040 return NGX_OK;
3039 } 3041 }
3040 3042