Page-level fragment for /events/past: skip the fetch pipeline on cache hits
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 42/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 領域
- backend, performance
調査の方向性
Start at the controller action for GET /events/past and the view's existing list, pagination, ETag, and card-fragment code; compare them with the prototype on the measurement branch. Review deletion staleness and html_safe handling before settling the cache key. Done means cold HTML remains byte-identical, warm requests use the page fragment with one MAX(updated_at) query, and the chosen invalidation semantics are explicit.
索引モデルが issue の本文から書いたものです。
説明
A benchmarked prototype cut the steady-state (warm-fragment) cost of GET /events/past by 84% (43,426 -> 7,104 GC objects per request) and its queries from 6 to 1 by serving the whole list from one page-level fragment: on a hit, the controller skips the COUNT, the eager loads, the decoration and the render entirely; only the ETag's MAX(updated_at) query runs.
Today each card fragment is checked after the pipeline has already loaded and decorated all 20 records, so warm requests pay the full fetch cost to render from cache.
Prototype shape (verified: cold HTML byte-identical, warm fragment serves the full card set)
- Key:
['events/past-page', I18n.locale, params[:page].to_i, MAX(updated_at) etag source] - Controller:
read_fragmenton that key beforefetch_past_events; on a hit, the view outputs the stored HTML - View:
cache(..., skip_digest: true)around the existing list + pagination markup - Measured: warm 43,426 -> 7,104 allocations (−84%), cold 73,401 -> 73,803 (+0.5%, the extra page write), cold rendered HTML identical
The prototype diff exists on the measurement branch and can be revived on request.
Staleness semantics to review before shipping: the key inherits the same exposure as the existing ETag and card fragments — record deletions do not bump MAX(updated_at), so a deleted event stays visible until another tracked table row is touched. Whether that is acceptable (and whether the key should incorporate a tombstone counter or shorter horizon) is the main design question. The stored HTML is output with html_safe, standard for view fragments but worth an explicit look.
- 主要言語
- Ruby
- スター
- 105
- フォーク
- 206
- 平均マージ
- 1日 3時間
- マージ済み PR(30日)
- 74
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
codebar/planner のほかの issue
-
DashboardQuery eager-loads workshop_host with :sponsors in one join (same host-loss trap as #2975)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
codebar/planner の issue をすべて見る
似ている issue
-
Component: Ruby Type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
crmne/ruby_llm#1045 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
chore
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
AllYourBot/hostedgpt#818 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
slovensko-digital/autogram-portal#392 ·
メンテナーはふだん 1 日以内に返信