-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[optimizer] allow http caching for bundles #15880
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
added
release_note:enhancement
v6.2.0
v7.0.0
Team:Core
Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
review
labels
Jan 7, 2018
bmcconaghy
approved these changes
Jan 8, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
tylersmalley
approved these changes
Jan 9, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Verified 304 (Not Modified) responses for unchanged assets and 200 for updated assets.
epixa
added a commit
to epixa/kibana
that referenced
this pull request
Jan 9, 2018
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
added a commit
that referenced
this pull request
Jan 9, 2018
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
release_note:enhancement
review
Team:Core
Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
v6.2.0
v7.0.0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Even though we were sending the last-modified header before, the
browser wasn't actually caching anything because a no-cache value was
being sent for cache-control.
Closes #6520