summaryrefslogtreecommitdiffhomepage
path: root/src/http/ngx_http_cache.h
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2014-10-27 21:14:10 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2014-10-27 21:14:10 +0300
commit6255935e0fc6732dd06323085a22209103322c6a (patch)
tree951d50475de5e1a9a8aac0dc38cbec21f2b9448b /src/http/ngx_http_cache.h
parent83f00adc9b03197efac7e6b1c0100df6a7e4052f (diff)
downloadnginx-6255935e0fc6732dd06323085a22209103322c6a.tar.gz
nginx-6255935e0fc6732dd06323085a22209103322c6a.tar.bz2
Cache: multiple variants of a resource now can be stored.
If a variant stored can't be used to respond to a request, the variant hash is used as a secondary key. Additionally, if we previously switched to a secondary key, while storing a response to cache we check if the variant hash still apply. If not, we switch back to the original key, to handle cases when Vary changes.
Diffstat (limited to '')
-rw-r--r--src/http/ngx_http_cache.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/http/ngx_http_cache.h b/src/http/ngx_http_cache.h
index b65fd493f..f89766d58 100644
--- a/src/http/ngx_http_cache.h
+++ b/src/http/ngx_http_cache.h
@@ -65,6 +65,7 @@ struct ngx_http_cache_s {
ngx_array_t keys;
uint32_t crc32;
u_char key[NGX_HTTP_CACHE_KEY_LEN];
+ u_char main[NGX_HTTP_CACHE_KEY_LEN];
ngx_file_uniq_t uniq;
time_t valid_sec;
@@ -102,6 +103,7 @@ struct ngx_http_cache_s {
unsigned exists:1;
unsigned temp_file:1;
unsigned reading:1;
+ unsigned secondary:1;
};