Page-level fragment for /events/past: skip the fetch pipeline on cache hits
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- backend, performance
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Ruby
- Star
- 105
- Fork
- 206
- Merge trung bình
- 1 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 74
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của codebar/planner
-
DashboardQuery eager-loads workshop_host with :sponsors in one join (same host-loss trap as #2975)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của codebar/planner
Issue tương tự
-
revoir les metions de la DGEĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
betagouv/conseillers-entreprises#4720 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
zerocracy/judges-action#2692 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 6 ngày
-
agent:triaged bug bughunt pm:bundler priority:p1
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
SocketDev/socket-patch#896 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add Catalan (ca) translationĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
eurosky-social/eu-haul#32 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
e0ipso/self-review#171 ·
Maintainer thường phản hồi trong vòng 1 ngày