comparison src/http/ngx_http_cache.h @ 588:b6a5942a4e6a NGINX_0_8_46

nginx 0.8.46 *) Change: now the "proxy_no_cache", "fastcgi_no_cache", "uwsgi_no_cache", and "scgi_no_cache" directives affect on a cached response saving only. *) Feature: the "proxy_cache_bypass", "fastcgi_cache_bypass", "uwsgi_cache_bypass", and "scgi_cache_bypass" directives. *) Bugfix: nginx did not free memory in cache keys zones if there was an error during working with backend: the memory was freed only after inactivity time or on memory low condition.
author Igor Sysoev <http://sysoev.ru>
date Mon, 19 Jul 2010 00:00:00 +0400
parents ff463db0be31
children cde3626b2d0d
comparison
equal deleted inserted replaced
587:913af46ee783 588:b6a5942a4e6a
12 #include <ngx_core.h> 12 #include <ngx_core.h>
13 #include <ngx_http.h> 13 #include <ngx_http.h>
14 14
15 15
16 #define NGX_HTTP_CACHE_MISS 1 16 #define NGX_HTTP_CACHE_MISS 1
17 #define NGX_HTTP_CACHE_EXPIRED 2 17 #define NGX_HTTP_CACHE_BYPASS 2
18 #define NGX_HTTP_CACHE_STALE 3 18 #define NGX_HTTP_CACHE_EXPIRED 3
19 #define NGX_HTTP_CACHE_UPDATING 4 19 #define NGX_HTTP_CACHE_STALE 4
20 #define NGX_HTTP_CACHE_HIT 5 20 #define NGX_HTTP_CACHE_UPDATING 5
21 #define NGX_HTTP_CACHE_SCARCE 6 21 #define NGX_HTTP_CACHE_HIT 6
22 #define NGX_HTTP_CACHE_SCARCE 7
22 23
23 #define NGX_HTTP_CACHE_KEY_LEN 16 24 #define NGX_HTTP_CACHE_KEY_LEN 16
24 25
25 26
26 typedef struct { 27 typedef struct {
119 120
120 ngx_shm_zone_t *shm_zone; 121 ngx_shm_zone_t *shm_zone;
121 }; 122 };
122 123
123 124
125 ngx_int_t ngx_http_file_cache_new(ngx_http_request_t *r);
126 ngx_int_t ngx_http_file_cache_create(ngx_http_request_t *r);
124 void ngx_http_file_cache_create_key(ngx_http_request_t *r); 127 void ngx_http_file_cache_create_key(ngx_http_request_t *r);
125 ngx_int_t ngx_http_file_cache_open(ngx_http_request_t *r); 128 ngx_int_t ngx_http_file_cache_open(ngx_http_request_t *r);
126 void ngx_http_file_cache_set_header(ngx_http_request_t *r, u_char *buf); 129 void ngx_http_file_cache_set_header(ngx_http_request_t *r, u_char *buf);
127 void ngx_http_file_cache_update(ngx_http_request_t *r, ngx_temp_file_t *tf); 130 void ngx_http_file_cache_update(ngx_http_request_t *r, ngx_temp_file_t *tf);
128 ngx_int_t ngx_http_cache_send(ngx_http_request_t *); 131 ngx_int_t ngx_http_cache_send(ngx_http_request_t *);
132 char *ngx_http_file_cache_set_slot(ngx_conf_t *cf, ngx_command_t *cmd, 135 char *ngx_http_file_cache_set_slot(ngx_conf_t *cf, ngx_command_t *cmd,
133 void *conf); 136 void *conf);
134 char *ngx_http_file_cache_valid_set_slot(ngx_conf_t *cf, ngx_command_t *cmd, 137 char *ngx_http_file_cache_valid_set_slot(ngx_conf_t *cf, ngx_command_t *cmd,
135 void *conf); 138 void *conf);
136 139
137 ngx_int_t ngx_http_cache(ngx_http_request_t *r, ngx_array_t *no_cache);
138 char *ngx_http_no_cache_set_slot(ngx_conf_t *cf, ngx_command_t *cmd,
139 void *conf);
140
141 140
142 extern ngx_str_t ngx_http_cache_status[]; 141 extern ngx_str_t ngx_http_cache_status[];
143 142
144 143
145 #endif /* _NGX_HTTP_CACHE_H_INCLUDED_ */ 144 #endif /* _NGX_HTTP_CACHE_H_INCLUDED_ */