summaryrefslogtreecommitdiffhomepage
path: root/src/http/ngx_http_upstream.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/ngx_http_upstream.c')
-rw-r--r--src/http/ngx_http_upstream.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index 5b55b263b..262466b11 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -2498,6 +2498,10 @@ ngx_http_upstream_send_response(ngx_http_request_t *r, ngx_http_upstream_t *u)
r->cache->date = now;
r->cache->body_start = (u_short) (u->buffer.pos - u->buffer.start);
+ if (u->headers_in.etag) {
+ r->cache->etag = u->headers_in.etag->value;
+ }
+
ngx_http_file_cache_set_header(r, u->buffer.start);
} else {