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

feat: Bug or feature? Server-side calls are not being cached #1833

Open
Sid-Turner-Ellis opened this issue Apr 21, 2024 · 0 comments
Open

feat: Bug or feature? Server-side calls are not being cached #1833

Sid-Turner-Ellis opened this issue Apr 21, 2024 · 0 comments
Labels
🌟 enhancement New feature or request

Comments

@Sid-Turner-Ellis
Copy link

Is your feature request related to a problem? Please describe.

Not sure if this is a bug or a missing feature, but one of the key patterns with the app router is to call fetch in multiple components and have those requests cached on a per-request level (https://nextjs.org/docs/app/building-your-application/data-fetching/patterns#fetching-data-where-its-needed).

Right now, calling the same query in multiple RSC will cause multiple requests.

Describe the solution you'd like to see

Ideally, all procedures would make use of reacts Cache function

Describe alternate solutions

Right now, i'm having to wrap the rTRPC calls in react's Cache function:

api.post.hello = cache(() => api.post.hello())

Additional information

No response

@Sid-Turner-Ellis Sid-Turner-Ellis added the 🌟 enhancement New feature or request label Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌟 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant