Conversation
requireAuthはBetter AuthのgetSessionが書いたSet-Cookieを捨てていた。cookie cacheの 寿命は60秒で、再発行はclientのget-session(起動・focus・online復帰)だけが担うため、 画面を開いたまま60秒を過ぎると以降のrequestは毎回findSessionでsessionとuserを 順に引いていた。getSessionをreturnHeadersで呼び、handlerの応答にSet-Cookieを付ける。 一覧と詳細は、Freeのときだけplanを待ってからunlocked判定を引いていた。 unlocked判定はplanに依存しないので同じ波で引く。Proでは使わないクエリが1本増えるが、 indexを使うLIMIT 5で、並列なので待ちは増えない。 Refs #195 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
前のcommitはunlocked判定をplanと並列に引く別クエリにしたため、Freeのクエリ数は 減らず、Proは使わないクエリが一覧と詳細のたびに1本増えていた。判定を一覧と詳細の 行を引くSQLの列にする。Freeは1クエリ減り、Proは変更前と同じクエリ数に戻る。 isRecipeLockedForPlanはplanと真偽値の論理積だけになるので除き、単体テストも消す。 Freeのロックの挙動はtest/db/recipes.repository.test.tsが実DBで確かめている。 Refs #195 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ADR 0020は一覧と詳細がgetUnlockedRecipeIdSetを使うと書いていたが、判定は行を引く SQLの列になった。ADR 0012は認証の照会をNeonへ1往復としていたが、findSessionは sessionとuserを順に引くので2往復になる。 Refs #195 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
perf(api): 認証の cookie cache 再発行を返し、Free の unlocked 判定を同じ波で引く
perf(api): サムネイルの元画像確認と派生画像の取得を並列にする
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.
No description provided.