[httpd] Add "max-age=0" to Cache-Control header to force browsers to

always revalidate cached content
This commit is contained in:
chme 2020-09-20 12:34:13 +02:00
parent 91ec155ecd
commit d29f56f3eb

View File

@ -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;