Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data fetching could be deduped if already in-flight #19238

Closed
Timer opened this issue Nov 17, 2020 · 2 comments · Fixed by #22781
Closed

Data fetching could be deduped if already in-flight #19238

Timer opened this issue Nov 17, 2020 · 2 comments · Fixed by #22781
Assignees
Milestone

Comments

@Timer
Copy link
Member

Timer commented Nov 17, 2020

This was for a getServerSideProps route:
image

We could dedupe this call as an optimization.

@Timer Timer added this to the iteration 13 milestone Nov 17, 2020
@Timer Timer self-assigned this Nov 17, 2020
@Timer Timer added point: 2 and removed point: 2 labels Nov 17, 2020
@Timer Timer changed the title Data fetches can be duplicated on canary Data fetching could be deduped if already in-flight Nov 18, 2020
@timneutkens timneutkens modified the milestones: iteration 13, iteration 14 Dec 1, 2020
@Timer
Copy link
Member Author

Timer commented Jan 4, 2021

x-ref: #14432

@shuding shuding self-assigned this Mar 4, 2021
@kodiakhq kodiakhq bot closed this as completed in #22781 Mar 5, 2021
kodiakhq bot pushed a commit that referenced this issue Mar 5, 2021
This PR adds request deduplication for `_getServerData`. If a request with the same URL is already in-flight, we don't send another new request. When a request succeeds or fails, we delete the cache.

A potential improvement this brings is, when `getServerSideProps` of a new route is slow to load, the user might keep clicking on the link which causes new requests, and the route will never update because results of old requests were ditched. Also adds a test case for this scenario.

Closes #19238.
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants