From 662bfa529bb8e64253e34cf11df47db162d67ed1 Mon Sep 17 00:00:00 2001 From: chme Date: Sat, 26 Oct 2019 12:01:15 +0200 Subject: [PATCH] [httpd] Force browsers to always revalidate their cached versions Setting Cache-Control to "no-cache" tells a client to always make a request to check if the version in the client cache is still valid (response code 403 not modified). --- src/httpd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/httpd.c b/src/httpd.c index f66109b2..4a3ce341 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"); + evhttp_add_header(output_headers, "Cache-Control", "private no-cache"); evhttp_add_header(output_headers, "ETag", etag); return false; @@ -337,7 +337,7 @@ httpd_request_not_modified_since(struct evhttp_request *req, const 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"); + evhttp_add_header(output_headers, "Cache-Control", "private no-cache"); evhttp_add_header(output_headers, "Last-Modified", last_modified); return false;