Repository navigation
Pre-compute footnotes in cached_content on save - #24
Merged
Merged
Conversation
The generate_cached_content callback already creates a Renderer with a
FootnoteRegistry and processes all footnotes, but discards the registry
after rendering. On every page view, extract_footnotes_from_content then
re-parses the raw JSON to rebuild this data.
For JSONB columns (BlockContent), cached_content now stores a structured
hash: { "html" => rendered_html, "footnotes" => processed_footnotes }.
For TEXT columns (Post), behaviour is unchanged (plain HTML string).
This eliminates all runtime JSON parsing for display when paired with
the corresponding RichTextComponent changes in panda-cms.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jfi
force-pushed
the
perf/precompute-footnotes-in-cached-content
branch
from
March 24, 2026 20:07
a8ab610 to
a3db3df
Compare
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
generate_cached_contentnow stores{ "html" => rendered_html, "footnotes" => processed_footnotes }for JSONB columns (BlockContent) instead of plain HTMLMotivation
AppSignal shows p95 transaction_duration spiking above 3s on
Panda::CMS::PagesController#show. The RichTextComponent re-parses raw EditorJS JSON on every page view to extract footnotes, even though this data was already computed duringgenerate_cached_content. This eliminates that runtime parsing.Test plan
🤖 Generated with Claude Code