-
Notifications
You must be signed in to change notification settings - Fork 26.4k
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
Next useCache option set to false
which causes each request to require everything all over again.
#42349
Comments
I'll only add that I think this issue is critical. Basically all non edge hosted apps got hit a lot (performance wise) with this change. I would be very happy to support with analyzing / explaining the problem and trying to fix it. |
Great work |
The problem was probably introduced here: 889af9f in 12.3.2-canary.29 which explains why it's a problem also in other issues. |
false
which causes request for everything require everything all over again.false
which causes each request to require everything all over again.
Same problem here. Lighthouse performance score goes down from 95 to 53. Time to interactive is up to 12.5 seconds. If I remove the middleware it is back to normal. |
Follow-up to #41402 this re-enables the sandbox cache and updates to leverage our global `AsyncLocalStorage` for isolating request meta in both the edge and Node.js runtime. Closes: #42349 Closes: #38235 Closes: #42225 Closes: #42351 ## Bug - [x] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm build && pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
The above patch is now available in |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
next start
Describe the Bug
In next 12.3.2 a change was made that turns off cacheing of required modules: https://github.com/vercel/next.js/blob/canary/packages/next/server/next-server.ts#L2132 .
I imagine the reason for that was some problems when running next on serverless functions. Because of that when running next in a node environment (using next start or custom next server) each request requires all modules everytime, which takes ages. Overall the performance of next ran using next start dropps dramatically in 12.3.2 and later versions.
Average response time with cache enabled is around 50ms. With cache disabled 500ms. 10x worse performance. And it gets even worse when handling multiple requests at the same time.
Expected Behavior
Allow users to set this flag from config or decide if cache should be used based on runtime.
When cache is set to true reuse cached modules (that part is already happening when useCache is true).
Link to reproduction
https://stg.parkschannel.app.elpassion.com/
To Reproduce
Just visit the page and see how fast it is loading.
Example node performance summary when running same page locally:
The text was updated successfully, but these errors were encountered: