Skip to content

fix: remove CDN shared-cache header from /problems (#3862)#3874

Merged
KATO-Hiro merged 2 commits into
stagingfrom
hotfix/#3862
Jul 19, 2026
Merged

fix: remove CDN shared-cache header from /problems (#3862)#3874
KATO-Hiro merged 2 commits into
stagingfrom
hotfix/#3862

Conversation

@KATO-Hiro

@KATO-Hiro KATO-Hiro commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

close #3862

Summary by CodeRabbit

  • バグ修正

    • セッション内容が異なる「問題」ページで共有キャッシュを無効化し、ユーザー間で誤った内容が表示されるリスクを低減しました。
    • 投票統計の取得に失敗した場合も、ページを表示できるよう改善しました。
  • テスト

    • 匿名・ログイン済みのページで、共有キャッシュが利用されないことを確認するテストを更新しました。
  • ドキュメント

    • HTTPキャッシュヘッダーの運用ルールと注意点を追加しました。

KATO-Hiro and others added 2 commits July 19, 2026 12:52
Anonymous responses cached without `Vary: Cookie` are served to
logged-in users too, since shared caches key on URL + method + the
headers named by Vary (RFC 9111). The prior guard only stopped the
cache write for logged-in responses, not delivery of an already-cached
anonymous entry to a cookie-bearing request.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 77af414c-a062-497f-8895-2b047abb1601

📥 Commits

Reviewing files that changed from the base of the PR and between 7661ce6 and 12c6eea.

📒 Files selected for processing (4)
  • .claude/rules/sveltekit.md
  • e2e/problems_cache.spec.ts
  • src/routes/problems/+page.server.ts
  • src/routes/problems/page_server.test.ts

📝 Walkthrough

Walkthrough

Changes

problemsキャッシュ制御

Layer / File(s) Summary
キャッシュポリシーとルート実装
.claude/rules/sveltekit.md, src/routes/problems/+page.server.ts
/problemsの共有キャッシュ用setHeadersを削除し、投票統計取得失敗時は空の結果を返す運用ルールを追加。
単体テストの期待値更新
src/routes/problems/page_server.test.ts
匿名ユーザーおよびtagIds指定時にsetHeadersが呼ばれないことを検証。
E2Eキャッシュ回帰検証
e2e/problems_cache.spec.ts
匿名・ログイン済みレスポンスに共有キャッシュ用ヘッダーが付かないことを検証。

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: river0525

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed タイトルは /problems のCDN共有キャッシュヘッダー削除という主変更を簡潔に表しています。
Linked Issues check ✅ Passed 共有キャッシュヘッダーの削除と関連テスト更新で、ログイン状態が匿名キャッシュに置き換わる問題の修正目的に合致しています。
Out of Scope Changes check ✅ Passed 変更は /problems のキャッシュ修正とそれを支えるテスト・規則更新に限定され、明らかな逸脱はありません。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hotfix/#3862

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@KATO-Hiro KATO-Hiro left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@KATO-Hiro
KATO-Hiro merged commit f450953 into staging Jul 19, 2026
3 checks passed
@KATO-Hiro
KATO-Hiro deleted the hotfix/#3862 branch July 19, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] 一覧表 ページのみログインが解除される状態が不定期で起きているので、原因を特定して修正しましょう

1 participant