Groonga 3.0.9 Source Code Document
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ngx_http_cache.h
Go to the documentation of this file.
1 
2 /*
3  * Copyright (C) Igor Sysoev
4  * Copyright (C) Nginx, Inc.
5  */
6 
7 
8 #ifndef _NGX_HTTP_CACHE_H_INCLUDED_
9 #define _NGX_HTTP_CACHE_H_INCLUDED_
10 
11 
12 #include <ngx_config.h>
13 #include <ngx_core.h>
14 #include <ngx_http.h>
15 
16 
17 #define NGX_HTTP_CACHE_MISS 1
18 #define NGX_HTTP_CACHE_BYPASS 2
19 #define NGX_HTTP_CACHE_EXPIRED 3
20 #define NGX_HTTP_CACHE_STALE 4
21 #define NGX_HTTP_CACHE_UPDATING 5
22 #define NGX_HTTP_CACHE_HIT 6
23 #define NGX_HTTP_CACHE_SCARCE 7
24 
25 #define NGX_HTTP_CACHE_KEY_LEN 16
26 
27 
28 typedef struct {
30  time_t valid;
32 
33 
34 typedef struct {
37 
38  u_char key[NGX_HTTP_CACHE_KEY_LEN
39  - sizeof(ngx_rbtree_key_t)];
40 
41  unsigned count:20;
42  unsigned uses:10;
43  unsigned valid_msec:10;
44  unsigned error:10;
45  unsigned exists:1;
46  unsigned updating:1;
47  unsigned deleting:1;
48  /* 11 unused bits */
49 
51  time_t expire;
52  time_t valid_sec;
53  size_t body_start;
54  off_t fs_size;
56 
57 
61  uint32_t crc32;
63 
65  time_t valid_sec;
66  time_t last_modified;
67  time_t date;
68 
69  size_t header_start;
70  size_t body_start;
71  off_t length;
72  off_t fs_size;
73 
77 
79 
82 
85 
87 
88  unsigned lock:1;
89  unsigned waiting:1;
90 
91  unsigned updated:1;
92  unsigned updating:1;
93  unsigned exists:1;
94  unsigned temp_file:1;
95 };
96 
97 
98 typedef struct {
99  time_t valid_sec;
101  time_t date;
102  uint32_t crc32;
103  u_short valid_msec;
104  u_short header_start;
105  u_short body_start;
107 
108 
109 typedef struct {
115  off_t size;
117 
118 
122 
124 
125  off_t max_size;
126  size_t bsize;
127 
128  time_t inactive;
129 
135 
137 };
138 
139 
148 time_t ngx_http_file_cache_valid(ngx_array_t *cache_valid, ngx_uint_t status);
149 
151  void *conf);
153  void *conf);
154 
155 
157 
158 
159 #endif /* _NGX_HTTP_CACHE_H_INCLUDED_ */