Skip to content

[#89] Add ISR caching to discover page#101

Merged
realproject7 merged 1 commit intomainfrom
task/89-discover-caching
Mar 15, 2026
Merged

[#89] Add ISR caching to discover page#101
realproject7 merged 1 commit intomainfrom
task/89-discover-caching

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

Fixes #89

  • Added export const revalidate = 120 to the discover page server component
  • Next.js ISR regenerates the page at most every 2 minutes, so the ~200 RPC calls for trending/rising tabs are cached between requests
  • Multicall batching for enrichWithOnChain not added — the ISR cache eliminates the per-request cost which is the primary issue. Multicall could be a follow-up optimization if needed.

Test plan

  • Discover page loads normally on all tabs (new, trending, rising, completed)
  • Subsequent loads within 2 minutes are served from cache (faster response)
  • After 2 minutes, page revalidates with fresh data

🤖 Generated with Claude Code

Adds Next.js ISR with 120-second revalidation window so the ~200 RPC
calls for trending/rising rankings happen at most once per 2 minutes
instead of on every page load.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T2b Review — APPROVE

One-line ISR fix — export const revalidate = 120 on the discover page. Caches the ~200 RPC calls between regenerations. Simple, correct, and the highest-impact fix for this issue.

Multicall batching (mentioned in the issue as optional) could further optimize the regeneration itself, but ISR alone is sufficient to resolve the scaling concern.

LGTM ✓

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Summary

This adds route-level ISR to the discover page, which caches the expensive ranking/on-chain enrichment work between requests and directly addresses the repeated-RPC problem described in issue #89.

Findings

  • No blocking findings.

Decision

Approving because src/app/discover/page.tsx now opts into a reasonable revalidation window, the route remains cacheable with the current server-client setup, and the refreshed lint/typecheck run passed.

@realproject7 realproject7 merged commit 9699dd1 into main Mar 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Discover page makes ~200 RPC calls per load — add caching

2 participants