comparison src/http/ngx_http_cache.h @ 5441:43ccaf8e8728

Upstream: cache revalidation with conditional requests. The following new directives are introduced: proxy_cache_revalidate, fastcgi_cache_revalidate, scgi_cache_revalidate, uwsgi_cache_revalidate. Default is off. When set to on, they enable cache revalidation using conditional requests with If-Modified-Since for expired cache items. As of now, no attempts are made to merge headers given in a 304 response during cache revalidation with headers previously stored in a cache item. Headers in a 304 response are only used to calculate new validity time of a cache item.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 18 Nov 2013 20:48:22 +0400
parents d620f497c50f
children 2fe1967f8854
comparison
equal deleted inserted replaced
5440:cbb9a6c7493c 5441:43ccaf8e8728
17 #define NGX_HTTP_CACHE_MISS 1 17 #define NGX_HTTP_CACHE_MISS 1
18 #define NGX_HTTP_CACHE_BYPASS 2 18 #define NGX_HTTP_CACHE_BYPASS 2
19 #define NGX_HTTP_CACHE_EXPIRED 3 19 #define NGX_HTTP_CACHE_EXPIRED 3
20 #define NGX_HTTP_CACHE_STALE 4 20 #define NGX_HTTP_CACHE_STALE 4
21 #define NGX_HTTP_CACHE_UPDATING 5 21 #define NGX_HTTP_CACHE_UPDATING 5
22 #define NGX_HTTP_CACHE_HIT 6 22 #define NGX_HTTP_CACHE_REVALIDATED 6
23 #define NGX_HTTP_CACHE_SCARCE 7 23 #define NGX_HTTP_CACHE_HIT 7
24 #define NGX_HTTP_CACHE_SCARCE 8
24 25
25 #define NGX_HTTP_CACHE_KEY_LEN 16 26 #define NGX_HTTP_CACHE_KEY_LEN 16
26 27
27 28
28 typedef struct { 29 typedef struct {
141 ngx_int_t ngx_http_file_cache_create(ngx_http_request_t *r); 142 ngx_int_t ngx_http_file_cache_create(ngx_http_request_t *r);
142 void ngx_http_file_cache_create_key(ngx_http_request_t *r); 143 void ngx_http_file_cache_create_key(ngx_http_request_t *r);
143 ngx_int_t ngx_http_file_cache_open(ngx_http_request_t *r); 144 ngx_int_t ngx_http_file_cache_open(ngx_http_request_t *r);
144 void ngx_http_file_cache_set_header(ngx_http_request_t *r, u_char *buf); 145 void ngx_http_file_cache_set_header(ngx_http_request_t *r, u_char *buf);
145 void ngx_http_file_cache_update(ngx_http_request_t *r, ngx_temp_file_t *tf); 146 void ngx_http_file_cache_update(ngx_http_request_t *r, ngx_temp_file_t *tf);
147 void ngx_http_file_cache_update_header(ngx_http_request_t *r);
146 ngx_int_t ngx_http_cache_send(ngx_http_request_t *); 148 ngx_int_t ngx_http_cache_send(ngx_http_request_t *);
147 void ngx_http_file_cache_free(ngx_http_cache_t *c, ngx_temp_file_t *tf); 149 void ngx_http_file_cache_free(ngx_http_cache_t *c, ngx_temp_file_t *tf);
148 time_t ngx_http_file_cache_valid(ngx_array_t *cache_valid, ngx_uint_t status); 150 time_t ngx_http_file_cache_valid(ngx_array_t *cache_valid, ngx_uint_t status);
149 151
150 char *ngx_http_file_cache_set_slot(ngx_conf_t *cf, ngx_command_t *cmd, 152 char *ngx_http_file_cache_set_slot(ngx_conf_t *cf, ngx_command_t *cmd,