Mercurial > hg > nginx-vendor-1-0
annotate src/http/ngx_http_cache.h @ 58:b55cbf18157e NGINX_0_1_29
nginx 0.1.29
*) Feature: the ngx_http_ssi_module supports "include virtual" command.
*) Feature: the ngx_http_ssi_module supports the condition command like
'if expr="$NAME"' and "else" and "endif" commands. Only one nested
level is supported.
*) Feature: the ngx_http_ssi_module supports the DATE_LOCAL and
DATE_GMT variables and "config timefmt" command.
*) Feature: the "ssi_ignore_recycled_buffers" directive.
*) Bugfix: the "echo" command did not show the default value for the
empty QUERY_STRING variable.
*) Change: the ngx_http_proxy_module was rewritten.
*) Feature: the "proxy_redirect", "proxy_pass_request_headers",
"proxy_pass_request_body", and "proxy_method" directives.
*) Feature: the "proxy_set_header" directive. The "proxy_x_var" was
canceled and must be replaced with the proxy_set_header directive.
*) Change: the "proxy_preserve_host" is canceled and must be replaced
with the "proxy_set_header Host $host" and the "proxy_redirect off"
directives, the "proxy_set_header Host $host:$proxy_port" directive
and the appropriate proxy_redirect directives.
*) Change: the "proxy_set_x_real_ip" is canceled and must be replaced
with the "proxy_set_header X-Real-IP $remote_addr" directive.
*) Change: the "proxy_add_x_forwarded_for" is canceled and must be
replaced with
the "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for"
directive.
*) Change: the "proxy_set_x_url" is canceled and must be replaced with
the "proxy_set_header X-URL http://$host:$server_port$request_uri"
directive.
*) Feature: the "fastcgi_param" directive.
*) Change: the "fastcgi_root", "fastcgi_set_var" and "fastcgi_params"
directive are canceled and must be replaced with the fastcgi_param
directives.
*) Feature: the "index" directive can use the variables.
*) Feature: the "index" directive can be used at http and server levels.
*) Change: the last index only in the "index" directive can be absolute.
*) Feature: the "rewrite" directive can use the variables.
*) Feature: the "internal" directive.
*) Feature: the CONTENT_LENGTH, CONTENT_TYPE, REMOTE_PORT, SERVER_ADDR,
SERVER_PORT, SERVER_PROTOCOL, DOCUMENT_ROOT, SERVER_NAME,
REQUEST_METHOD, REQUEST_URI, and REMOTE_USER variables.
*) Change: nginx now passes the invalid lines in a client request
headers or a backend response header.
*) Bugfix: if the backend did not transfer response for a long time and
the "send_timeout" was less than "proxy_read_timeout", then nginx
returned the 408 response.
*) Bugfix: the segmentation fault was occurred if the backend sent an
invalid line in response header; bug appeared in 0.1.26.
*) Bugfix: the segmentation fault may occurred in FastCGI fault
tolerance configuration.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" and "Cache-Control" headers.
*) Bugfix: nginx did not take into account trailing dot in "Host"
header line.
*) Bugfix: the ngx_http_auth_module did not work under Linux.
*) Bugfix: the rewrite directive worked incorrectly, if the arguments
were in a request.
*) Bugfix: nginx could not be built on MacOS X.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Thu, 12 May 2005 00:00:00 +0400 |
parents | 45fe5b98a9de |
children | c8cfb6c462ef |
rev | line source |
---|---|
0 | 1 |
2 /* | |
3 * Copyright (C) Igor Sysoev | |
4 */ | |
5 | |
6 | |
7 #ifndef _NGX_HTTP_CACHE_H_INCLUDED_ | |
8 #define _NGX_HTTP_CACHE_H_INCLUDED_ | |
9 | |
10 | |
11 #include <ngx_config.h> | |
12 #include <ngx_core.h> | |
13 #include <ngx_http.h> | |
14 | |
15 | |
16 /* | |
18 | 17 * The 3 bits allows the 7 uses before the cache entry allocation. |
0 | 18 * We can use maximum 7 bits, i.e up to the 127 uses. |
19 */ | |
20 #define NGX_HTTP_CACHE_LAZY_ALLOCATION_BITS 3 | |
21 | |
18 | 22 |
0 | 23 typedef struct { |
24 uint32_t crc; | |
25 ngx_str_t key; | |
26 time_t accessed; | |
27 | |
28 unsigned refs:20; /* 1048576 references */ | |
29 | |
30 unsigned count:NGX_HTTP_CACHE_LAZY_ALLOCATION_BITS; | |
31 | |
32 unsigned deleted:1; | |
33 unsigned expired:1; | |
34 unsigned memory:1; | |
35 unsigned mmap:1; | |
36 unsigned notify:1; | |
37 | |
38 ngx_fd_t fd; | |
39 #if (NGX_USE_HTTP_FILE_CACHE_UNIQ) | |
40 ngx_file_uniq_t uniq; /* no needed with kqueue */ | |
41 #endif | |
42 time_t last_modified; | |
43 time_t updated; | |
44 | |
45 union { | |
46 off_t size; | |
47 ngx_str_t value; | |
48 } data; | |
18 | 49 } ngx_http_cache_entry_t; |
0 | 50 |
51 | |
52 typedef struct { | |
53 time_t expires; | |
54 time_t last_modified; | |
55 time_t date; | |
56 off_t length; | |
57 size_t key_len; | |
58 char key[1]; | |
59 } ngx_http_cache_header_t; | |
60 | |
61 | |
62 #define NGX_HTTP_CACHE_HASH 7 | |
63 #define NGX_HTTP_CACHE_NELTS 4 | |
64 | |
65 typedef struct { | |
18 | 66 ngx_http_cache_entry_t *elts; |
0 | 67 size_t hash; |
68 size_t nelts; | |
69 time_t life; | |
70 time_t update; | |
71 #if (NGX_THREADS) | |
72 ngx_mutex_t mutex; | |
73 #endif | |
74 ngx_pool_t *pool; | |
75 } ngx_http_cache_hash_t; | |
76 | |
77 | |
78 typedef struct { | |
79 ngx_http_cache_hash_t *hash; | |
18 | 80 ngx_http_cache_entry_t *cache; |
0 | 81 ngx_file_t file; |
18 | 82 ngx_array_t key; |
0 | 83 uint32_t crc; |
84 u_char md5[16]; | |
85 ngx_path_t *path; | |
86 ngx_buf_t *buf; | |
87 time_t expires; | |
88 time_t last_modified; | |
89 time_t date; | |
90 off_t length; | |
26 | 91 size_t key_len; |
0 | 92 size_t file_start; |
26 | 93 ngx_file_uniq_t uniq; |
0 | 94 ngx_log_t *log; |
18 | 95 |
96 /* STUB */ | |
26 | 97 ssize_t header_size; |
18 | 98 ngx_str_t key0; |
99 } ngx_http_cache_t; | |
0 | 100 |
101 | |
22 | 102 typedef struct { |
26 | 103 ngx_path_t *path; |
22 | 104 ngx_str_t key; |
26 | 105 ngx_buf_t *buf; |
106 | |
107 unsigned file:1; | |
108 unsigned memory:1; | |
109 unsigned primary:1; | |
22 | 110 } ngx_http_cache_ctx_t; |
111 | |
0 | 112 |
113 #define NGX_HTTP_CACHE_STALE 1 | |
114 #define NGX_HTTP_CACHE_AGED 2 | |
115 #define NGX_HTTP_CACHE_THE_SAME 3 | |
116 | |
117 | |
26 | 118 ngx_int_t ngx_http_cache_get(ngx_http_request_t *r, ngx_http_cache_ctx_t *ctx); |
119 | |
120 ngx_int_t ngx_http_file_cache_get(ngx_http_request_t *r, | |
121 ngx_http_cache_ctx_t *ctx); | |
122 | |
123 ngx_int_t ngx_http_file_cache_open(ngx_http_cache_t *c); | |
124 | |
125 ngx_int_t ngx_http_cache_cleaner_handler(ngx_gc_t *gc, ngx_str_t *name, | |
126 ngx_dir_t *dir); | |
127 | |
128 | |
18 | 129 #if 0 |
130 | |
0 | 131 ngx_http_cache_t *ngx_http_cache_get(ngx_http_cache_hash_t *cache, |
132 ngx_http_cleanup_t *cleanup, | |
133 ngx_str_t *key, uint32_t *crc); | |
134 | |
135 ngx_http_cache_t *ngx_http_cache_alloc(ngx_http_cache_hash_t *hash, | |
136 ngx_http_cache_t *cache, | |
137 ngx_http_cleanup_t *cleanup, | |
138 ngx_str_t *key, uint32_t crc, | |
139 ngx_str_t *value, ngx_log_t *log); | |
140 void ngx_http_cache_free(ngx_http_cache_t *cache, | |
141 ngx_str_t *key, ngx_str_t *value, ngx_log_t *log); | |
142 void ngx_http_cache_lock(ngx_http_cache_hash_t *hash, ngx_http_cache_t *cache); | |
143 void ngx_http_cache_unlock(ngx_http_cache_hash_t *hash, | |
144 ngx_http_cache_t *cache, ngx_log_t *log); | |
145 | |
146 int ngx_http_cache_update_file(ngx_http_request_t *r,ngx_http_cache_ctx_t *ctx, | |
147 ngx_str_t *temp_file); | |
148 | |
149 int ngx_http_send_cached(ngx_http_request_t *r); | |
150 | |
151 | |
152 char *ngx_http_set_cache_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); | |
153 | |
18 | 154 #endif |
155 | |
0 | 156 |
157 #endif /* _NGX_HTTP_CACHE_H_INCLUDED_ */ |