diff options
| author | Maxim Dounin <mdounin@mdounin.ru> | 2014-10-27 21:13:58 +0300 |
|---|---|---|
| committer | Maxim Dounin <mdounin@mdounin.ru> | 2014-10-27 21:13:58 +0300 |
| commit | 1332e76b20a6a1e871904525d42b17dcaed81eec (patch) | |
| tree | e29436a0150547c91645468f4617a4e252e83c7b /src/http/ngx_http_cache.h | |
| parent | fc785b12a0fea9ff3d014ad27f37ac73cbe056e8 (diff) | |
| download | nginx-1332e76b20a6a1e871904525d42b17dcaed81eec.tar.gz nginx-1332e76b20a6a1e871904525d42b17dcaed81eec.tar.bz2 | |
Cache: hash of Vary headers now stored in cache.
To cache responses with Vary, we now calculate hash of headers listed
in Vary, and return the response from cache only if new request headers
match.
As of now, only one variant of the same resource can be stored in cache.
Diffstat (limited to '')
| -rw-r--r-- | src/http/ngx_http_cache.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/http/ngx_http_cache.h b/src/http/ngx_http_cache.h index 1cfd9fe84..a5886631b 100644 --- a/src/http/ngx_http_cache.h +++ b/src/http/ngx_http_cache.h @@ -25,8 +25,9 @@ #define NGX_HTTP_CACHE_KEY_LEN 16 #define NGX_HTTP_CACHE_ETAG_LEN 42 +#define NGX_HTTP_CACHE_VARY_LEN 42 -#define NGX_HTTP_CACHE_VERSION 2 +#define NGX_HTTP_CACHE_VERSION 3 typedef struct { @@ -71,6 +72,8 @@ struct ngx_http_cache_s { time_t date; ngx_str_t etag; + ngx_str_t vary; + u_char variant[NGX_HTTP_CACHE_KEY_LEN]; size_t header_start; size_t body_start; @@ -112,6 +115,9 @@ typedef struct { u_short body_start; u_char etag_len; u_char etag[NGX_HTTP_CACHE_ETAG_LEN]; + u_char vary_len; + u_char vary[NGX_HTTP_CACHE_VARY_LEN]; + u_char variant[NGX_HTTP_CACHE_KEY_LEN]; } ngx_http_file_cache_header_t; |
