未作成の期間の404を長時間キャッシュしないようにする - #235
Merged
Merged
Conversation
過去ランキング詳細のキャッシュ指定を、中身を見る前に立てていた。そのため まだ締めていない期間を引いた404が s-maxage=86400 で共有キャッシュに載り、 後から締めても丸一日「無い」と返り続ける状態だった。2026-07 を遡って作った ときに実際に踏んでいる。 一覧が空のとき(#231)と同じ扱いにし、見つからなかった場合だけ短命にする。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
kojira
pushed a commit
that referenced
this pull request
Aug 2, 2026
kojira
pushed a commit
that referenced
this pull request
Aug 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
rankingArchiveGoの詳細取得で、キャッシュ指定を中身を見る前に立てていた。そのためまだ締めていない期間を引いた 404 が
s-maxage=86400で共有キャッシュに載り、後から締めても丸一日「無い」と返り続ける。
2026-07 を遡って作ったときに実際に踏んでいる。復元中に何度か確認のため叩いており、
その 404 が Fastly の POP に残っている:
一覧が空のときに同じことが起きた(#231)のと同じ種類の穴。あちらだけ直して、
詳細側が残っていた。
変更
archiveDetailCacheControl(found bool)を切り出し、キャッシュ指定はloadArchiveDetailの結果が分かってから立てる。見つからなかったときは一覧の空と同じく30秒。
テスト
TestArchiveDetailCacheControlを追加(未作成は短命/締め済みは長命)。Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Generated by Claude Code