mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
By setting cache-control to must-revalidate, we indicate to the browser that it should send the if-none-match header with the last known etag value. If the etags match, the server responds with a 304 and no body, and if they don't the server responds with a 200 and a body along with a new etag. This ensures a cache is always invalidated when a bundle changes, like when Kibana is upgraded or a plugin is installed. We no longer send the last-modified header because we don't want the browser caching based on time. Doing so can be unpredictable since the browser may not agree with the server's definitions of DST, and the server time itself can be changed.
This commit is contained in:
parent
f8f8141191
commit
59726c0b75
1 changed files with 1 additions and 1 deletions
|
@ -67,7 +67,7 @@ export async function createDynamicAssetResponse(options) {
|
|||
const response = request.generateResponse(replacePlaceholder(read, publicPath));
|
||||
response.code(200);
|
||||
response.etag(`${hash}-${publicPath}`);
|
||||
response.header('last-modified', stat.mtime.toUTCString());
|
||||
response.header('cache-control', 'must-revalidate');
|
||||
response.type(request.server.mime.path(path).type);
|
||||
return response;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue