-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[SDH] Cache-Control optimizations #64518
Conversation
💚 Build SucceededTo update your PR or re-run it, just comment with: |
Feel free to close this PR if you feel like this is not the way to go. Since I was playing around with the properties, I decided it would be good not to lose this in case we wanted to apply it. |
Pinging @elastic/kibana-operations (Team:Operations) |
awesome! it's not not the way to go, you're certainly right about the round trip. @restrry opened another approach here if you have any thoughts and want to weigh in. @restrry if you get a chance can you triage this? adding the platform label too. |
Pinging @elastic/kibana-platform (Team:Platform) |
yes. #64414 is aimed to solve the same problem. |
Thanks for confirming! Closing this PR then. |
Summary
Our Cache policy for serving JS and CSS bundled assets is
"must-revalidate"
, enforcing every request to actually reach the Kibana server to revalidate the theetag
via theIf-None-Match
header.This makes Kibana super slow under connections with a high latency. It is easy to check with the network throttling the Dev Tools: In Chrome, if you set it to limit the network speed to
Slow 3G
, you can tell that, even when all the requests receive a304
response, it takes MINUTES!! to load all the resources in the Home application:Mind the timings in the bottom of the screenshot
I tested locally changing the cache policy to
cache-control: max-age=30; must-revalidate
(allow the browser to use the local files if they were validating less than 30s ago). With this, if I refresh the page before those 30s expire, the load time (with the throttling still on) is highly reduced:Maybe we want to mark the assets as stale as soon as they are served but allow the browsers to use them to load the pages as quick as possible while revalidating and downloading in the background. This PR adds a combination of
stale-while-revalidate
withmax-age
andmust-revalidate
?Checklist
Delete any items that are not applicable to this PR.
For maintainers