feat: preload feed on home page - #55
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Codex Review: Here are some suggestions.
Reply with @codex fix comments to fix any unresolved comments.
About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".
| try { | ||
| const request = new Request("https://bloom.local/api/search", { | ||
| method: "POST", | ||
| headers: { | ||
| "content-type": "application/json", | ||
| "x-forwarded-for": "server-internal", | ||
| }, |
There was a problem hiding this comment.
[P1] Server preload trips global rate limit
The new server-side fetchInitialFeed calls the search API with a hard-coded x-forwarded-for header of "server-internal". The rate limiter in src/app/api/_ratelimit.ts buckets requests by this header value and allows only 10 requests per 60 seconds. Because every SSR of the home page now uses the same header, the shared bucket will be exhausted after a handful of page loads, after which all users will see degraded or empty feeds until the window resets. This effectively rate-limits the entire site rather than per client IP.
Useful? React with 👍 / 👎.
|
Someone is attempting to deploy this pull request to the howwee20's projects Team on Vercel. To accomplish this, the commit author's email address needs to be associated with a GitHub account. Learn more about how to change the commit author information. |
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68cb072fc3548333960799de4bbf6c4c