Skip to content

Reduce numer of API calls in paper route#896

Open
gzurowski wants to merge 2 commits into
mainfrom
reduce-paper-api-calls
Open

Reduce numer of API calls in paper route#896
gzurowski wants to merge 2 commits into
mainfrom
reduce-paper-api-calls

Conversation

@gzurowski

Copy link
Copy Markdown
Member

When paper pages are rendered, the app currently makes up to 6 requests to the paper API and the document metadata API. This change reduces the number of API calls to 2 by persisting these requests in a render-scoped cache.

@gzurowski gzurowski requested a review from a team as a code owner June 4, 2026 08:50
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@vercel

vercel Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web Ready Ready Preview, Comment Jun 8, 2026 5:49am

@nicktytarenko nicktytarenko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice 🚀
this is a clean fix for the paper route duplication 👍🏼
I assumed Next's built-in fetch deduping would already collapse identical GETs in one render 🤷🏼

Wondering if it'd be worth doing this at the ApiClient / getPublic/fetchJson layer instead, so layout/page/generateMetadata dedupe everywhere we hit the API, not only on paper routes?

@gzurowski gzurowski force-pushed the reduce-paper-api-calls branch from 19d108b to 66a9ab0 Compare June 8, 2026 05:46
@sonarqubecloud

sonarqubecloud Bot commented Jun 8, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
12.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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.

3 participants