[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).
This commit is contained in:
chme 2019-10-26 12:01:15 +02:00
parent 41f51d43ac
commit 662bfa529b
1 changed files with 2 additions and 2 deletions

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");
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;