Skip to content

[6.x] [optimizer] allow http caching for bundles (#15880)#15933

Merged
epixa merged 1 commit intoelastic:6.xfrom
epixa:backport/6.x/pr-15880
Jan 9, 2018
Merged

[6.x] [optimizer] allow http caching for bundles (#15880)#15933
epixa merged 1 commit intoelastic:6.xfrom
epixa:backport/6.x/pr-15880

Conversation

@epixa
Copy link
Contributor

@epixa epixa commented Jan 9, 2018

Backports the following commits to 6.x:

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.
@epixa epixa added the backport This PR is a backport of another PR label Jan 9, 2018
@epixa epixa merged commit 59726c0 into elastic:6.x Jan 9, 2018
@epixa epixa deleted the backport/6.x/pr-15880 branch January 9, 2018 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant