Replies: 9 comments 5 replies
-
Based on few assumptions
Existing solution would be to use Official docsLazy loading with Example from the Docsimport dynamic from 'next/dynamic'
const DynamicHeader = dynamic(() => import('../components/header'), {
loading: () => <p>Loading...</p>,
})
export default function Home() {
return <DynamicHeader />
} |
Beta Was this translation helpful? Give feedback.
-
This is the "problem" with hydration frameworks. So called, x2 data problem. Here you can see, a summary of performance, and x2-ness of various frameworks: https://github.com/eknkc/ssr-benchmark You can use this https://github.com/jherr/njs13-n-plus-one/blob/main/tester/index.js (works for App Router), tool, to measure the impact of this additional data. The recommendation here is to massage your data within A consideration here is that, sensitive data, that's filtered as you render, but return from If you choose to do a dynamic escape, you will opt that subtree out of SSR, which is not great either. The Server Component architecture, can indeed help with this though, but it is not there just yet: #56283 (comment) - #42170 I think this discussion was also quite good to follow: #52119 But, yeah |
Beta Was this translation helpful? Give feedback.
-
@icyJoseph Thank you, my question is, is there any way to remove NEXT_DATA? Do you have any ideas? After all, it occupies a large amount of HTML and document space |
Beta Was this translation helpful? Give feedback.
-
@timneutkens @Timer Is there any way to delete NEXT_DATA? Do you have any ideas? After all, it takes up a lot of HTML and document space, Boss, can you answer that? Thank you |
Beta Was this translation helpful? Give feedback.
-
@icyJoseph yes,But I don't know how to solve it |
Beta Was this translation helpful? Give feedback.
-
@icyJoseph Sorry, buddy. We have already implemented the deletion |
Beta Was this translation helpful? Give feedback.
-
After following your links, @icyJoseph, here is how I understand it:
Still, hydration data could arrive at different moment. Some guessing why atm NEXT_DATA is alongside prerender:
Could the solution be to store NEXT_DATA server side in a short-lived cache, then let the client fetch it post load? |
Beta Was this translation helpful? Give feedback.
-
@timneutkens @Timer Is there any way to delete NEXT_DATA? Do you have any ideas? After all, it takes up a lot of HTML and document space, Boss, can you answer that? Thank you |
Beta Was this translation helpful? Give feedback.
-
I hope more people can participate in the discussion of this topic ! |
Beta Was this translation helpful? Give feedback.
-
Summary
I don't want to return data here?Our company has technical experts who have achieved this step。Can we consider delaying client hydration?
If the page data is not returned, the document will definitely become smaller, which is beneficial for improving loading time
Additional information
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions