Skip to content
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

Merged
merged 1 commit into from Aug 28, 2019

Conversation

@deads2k
Copy link
Contributor

commented Aug 26, 2019

Fixes #81945

/kind bug
/priority important-soon

cache-control headers are now set appropriately.  Only openapi is cacheable if etags match.
}
}

w.Header().Set("Cache-Control", "private")

This comment has been minimized.

Copy link
@liggitt

liggitt Aug 26, 2019

Member

no-cache, private

we want private clients to revalidate any cached content as well

This comment has been minimized.

Copy link
@liggitt

liggitt Aug 26, 2019

Member

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.

@deads2k deads2k force-pushed the deads2k:cache branch from 819628a to ffee663 Aug 26, 2019
@liggitt

This comment has been minimized.

Copy link
Member

commented Aug 26, 2019

looks reasonable to me, there are a couple other handler chains that we should add this to

@deads2k deads2k force-pushed the deads2k:cache branch from ffee663 to 0778f38 Aug 26, 2019
"net/http"
)

// WithCacheControl sets the Cache-Control header to no-cache, if it is for openapi and private otherwise because

This comment has been minimized.

Copy link
@liggitt

liggitt Aug 26, 2019

Member

update godoc to drop openapi reference

@deads2k deads2k force-pushed the deads2k:cache branch from 0778f38 to 7b59ced Aug 26, 2019
@liggitt

This comment has been minimized.

Copy link
Member

commented Aug 26, 2019

Boilerplate header is wrong for: /home/prow/go/src/k8s.io/kubernetes/staging/src/k8s.io/apiserver/pkg/endpoints/filters/cachecontrol.go
Boilerplate header is wrong for: /home/prow/go/src/k8s.io/kubernetes/staging/src/k8s.io/apiserver/pkg/endpoints/filters/cachecontrol_test.go

@liggitt

This comment has been minimized.

Copy link
Member

commented Aug 26, 2019

/approve

lgtm after boilerplate is updated

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Aug 26, 2019

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deads2k deads2k force-pushed the deads2k:cache branch from 7b59ced to f589c12 Aug 26, 2019
@k8s-ci-robot k8s-ci-robot added size/L and removed size/M labels Aug 26, 2019
@deads2k deads2k added the lgtm label Aug 26, 2019
@deads2k

This comment has been minimized.

Copy link
Contributor Author

commented Aug 26, 2019

/approve

lgtm after boilerplate is updated

fixed, tagged

@deads2k deads2k added this to the v1.16 milestone Aug 27, 2019
@k8s-ci-robot k8s-ci-robot merged commit 8af33f9 into kubernetes:master Aug 28, 2019
24 checks passed
24 checks passed
cla/linuxfoundation deads2k authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-conformance-image-test Skipped.
pull-kubernetes-conformance-kind-ipv6 Skipped.
pull-kubernetes-cross Skipped.
pull-kubernetes-dependencies Job succeeded.
Details
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-csi-serial Skipped.
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gce-iscsi Skipped.
pull-kubernetes-e2e-gce-iscsi-serial Skipped.
pull-kubernetes-e2e-gce-storage-slow Skipped.
pull-kubernetes-godeps Skipped.
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped.
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-node-e2e-containerd Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
pull-publishing-bot-validate Skipped.
tide In merge pool.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.