Merge pull request #833 from chme/cache_control

[httpd] Force browsers to always revalidate their cache
This commit is contained in:
Christian Meffert 2019-11-02 07:57:55 +01:00 committed by GitHub
commit cafdb96329
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 // Add cache headers to allow client side caching
output_headers = evhttp_request_get_output_headers(req); 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); evhttp_add_header(output_headers, "ETag", etag);
return false; 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 // Add cache headers to allow client side caching
output_headers = evhttp_request_get_output_headers(req); 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); evhttp_add_header(output_headers, "Last-Modified", last_modified);
return false; return false;