-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache Deck assets differently #30776
Conversation
Hi @xrstf. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
/retest |
1 similar comment
/retest |
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, thanks!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: michelle192837, xrstf The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This PR changes the client-side caching of static Deck assets.
There was already #6395, which added the original client-side caching code. It's not super obvious from the code, but this method relied on the
Last-Modified
header and the browser sending anIf-Not-Modified
header on subsequent revalidations. This works just fine when you run Deck locally, but if you peek into the container image for Deck, you'll seeI presume this is on purpose to achieve reproducible container images.
The Go HTTP serve will not send a
Last-Modified
header for files that have a 0 timestamp. Which is the case for all of them 馃榿 This unfortunately totally defeats the caching in a production setup.Later #10626 introduced the
deckVersion
, but so far only used it to display it in the sidebar.I now make use of this variable and add it as a cache busting header. This allows Deck to send strong caching headers, while after a Prow update clients would still be forced to fetch the new versions of all assets. This works independently of any file timestamps and I think is more robust in general.
Since #6395 was authored 6 years ago, I decided to also drop IE 6 support. At this point IE 6 is truly dead and MDN recommends not setting the
Pragma
header anymore. However I kept the HTTP/1.0-only proxy support, as I can imagine some complex Prow setups with legacy proxies in-between that are hard to upgrade.