From d29f56f3eb64ed651390cf02722bded1946ba64c Mon Sep 17 00:00:00 2001 From: chme Date: Sun, 20 Sep 2020 12:34:13 +0200 Subject: [PATCH] [httpd] Add "max-age=0" to Cache-Control header to force browsers to always revalidate cached content --- src/httpd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/httpd.c b/src/httpd.c index 8a12d5e7..7988ae41 100644 --- a/src/httpd.c +++ b/src/httpd.c @@ -301,7 +301,7 @@ httpd_request_etag_matches(struct evhttp_request *req, const char *etag) // Add cache headers to allow client side caching output_headers = evhttp_request_get_output_headers(req); - evhttp_add_header(output_headers, "Cache-Control", "private no-cache"); + evhttp_add_header(output_headers, "Cache-Control", "private,no-cache,max-age=0"); evhttp_add_header(output_headers, "ETag", etag); return false; @@ -338,7 +338,7 @@ httpd_request_not_modified_since(struct evhttp_request *req, time_t mtime) // Add cache headers to allow client side caching output_headers = evhttp_request_get_output_headers(req); - evhttp_add_header(output_headers, "Cache-Control", "private no-cache"); + evhttp_add_header(output_headers, "Cache-Control", "private,no-cache,max-age=0"); evhttp_add_header(output_headers, "Last-Modified", last_modified); return false;