Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Page-level fragment for /events/past: skip the fetch pipeline on cache hits

オープン
#2,976 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
42/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rails, ruby

調査の方向性

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_fragment on that key before fetch_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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

codebar/planner のほかの issue

codebar/planner の issue をすべて見る

似ている issue

Ruby の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。