-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
add cache-control headers to kube-apiserver #81946
Conversation
} | ||
} | ||
|
||
w.Header().Set("Cache-Control", "private") |
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.
no-cache, private
we want private clients to revalidate any cached content as well
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.
I actually think no-cache, private
is reasonable for all requests... that just makes clients verify the etag before using cached content, which they are doing with openapi content already. Other responses which don't include an etag would just make the client refetch.
looks reasonable to me, there are a couple other handler chains that we should add this to |
"net/http" | ||
) | ||
|
||
// WithCacheControl sets the Cache-Control header to no-cache, if it is for openapi and private otherwise because |
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.
update godoc to drop openapi reference
staging/src/k8s.io/apiserver/pkg/endpoints/filters/cachecontrol.go
Outdated
Show resolved
Hide resolved
|
/approve lgtm after boilerplate is updated |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, liggitt 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 |
fixed, tagged |
Fixes #81945
/kind bug
/priority important-soon