[release-4.16] OCPBUGS-70112: Add Cache-Control headers to console responses - #16921
[release-4.16] OCPBUGS-70112: Add Cache-Control headers to console responses#16921jrangelramos wants to merge 1 commit into
Conversation
Set restrictive cache headers (no-cache, no-store) by default on all responses via securityHeadersMiddleware, and override with aggressive caching (public, max-age=31536000, immutable) for content-hashed static assets under /static/. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@jrangelramos: This pull request references Jira Issue OCPBUGS-70112, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: jrangelramos The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@jrangelramos: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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-sigs/prow repository. I understand the commands that are listed here. |
Summary
no-cache, no-store, must-revalidate+Pragma: no-cache) by default on all responses viasecurityHeadersMiddlewarepublic, max-age=31536000, immutable) for content-hashed static assets under/static/securityHeadersMiddlewarewrap on the static handler (the outer mux-level middleware already covers it)Test plan
go build ./cmd/bridge/...compiles cleanlygo test ./pkg/server/...— 3 new tests pass:TestSecurityHeadersMiddleware— all 6 headers (4 existing + 2 new)TestStaticCacheHeaders— static handler overrides restrictive defaultsTestNonStaticEndpointHasNoCacheHeaders— API endpoints getno-storeindex.htmlgetsno-store,/static/bundles getmax-age=31536000🤖 Generated with Claude Code