fix(web): cache static assets#1895
Conversation
🦋 Changeset detectedLatest commit: ca383b1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2896795409
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: Floze <88098863+floze-the-genius@users.noreply.github.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Related Issue
Resolves #1894
Problem
kimi webreturns HTTP 200 for fingerprinted Vite assets on every reload because the embedded server does not set a cache policy. This makes repeat page loads unnecessarily slow on lower-powered servers and clients.What changed
/assets/files withCache-Control: public, max-age=31536000, immutable.Cache-Control: no-cacheso deployments are revalidated instead of pinning an oldindex.html.Validation
pnpm exec vitest run packages/kap-server/test/webAssets.test.ts(4 passed)pnpm --filter @moonshot-ai/kap-server test(675 passed)pnpm --filter @moonshot-ai/kap-server run typecheckpnpm --filter @moonshot-ai/kap-server run buildpnpm exec changeset status --output=.tmp-changeset-status.jsongit diff --checkAI assistance
AI-assisted tooling was used to help implement and test this focused fix. I reviewed the resulting diff, cache behavior, edge cases, and validation results before submission.
Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.