Suspense and dealing with large data
I am trying to display loading states until the data is arrvied, but I am facing some struggles, for now I am making a profile page where I am fetching large user data with just one createAsync with deferStream: true, this requires me to wrap the whole page in Suspense I am thinking this will lead to me making one large loading layout for just one suspense I don't think this is convenient.
Should I be fetching user data just by one createAsync or fetch some user data seperately I have about 22.5kb of data just by one fetch. should I have multiple fetches which I think should Allow me to use multiple suspenses
here is what I am doing and what I think I should change but I want just approval or direction I might be wrong
the user has information about themselves, skills and services. for now what I am doing is just fetching everything once which leads me to using one suspense.
What I think I should be doing is making multiple fetch request for skills services and their information that will allow me to use multiple suspense so I can make desired loading states.
What approach should I take? is loading everything with just one fetch and displaying one loading state convenient?
for now
Slow 4g: takes about 11s to load and on 9s the loading state appears until that loading state the page is white screen
Fast 4g: takes about 4.29s to load and on 2.34s appears the loading state
No throttling: takes about 445ms to load and on 340ms the loading state comes in
First when I started building the page I didn't care that much about suspense just used switch and show.
I also thought for some reason that I would be able to access user().services for example and I thought I would have multiple suspenses?
In general I find this topic little confusing so if Anyone could guide me I would be thankful.
Should I be fetching user data just by one createAsync or fetch some user data seperately I have about 22.5kb of data just by one fetch. should I have multiple fetches which I think should Allow me to use multiple suspenses
here is what I am doing and what I think I should change but I want just approval or direction I might be wrong
the user has information about themselves, skills and services. for now what I am doing is just fetching everything once which leads me to using one suspense.
What I think I should be doing is making multiple fetch request for skills services and their information that will allow me to use multiple suspense so I can make desired loading states.
What approach should I take? is loading everything with just one fetch and displaying one loading state convenient?
for now
Slow 4g: takes about 11s to load and on 9s the loading state appears until that loading state the page is white screen
Fast 4g: takes about 4.29s to load and on 2.34s appears the loading state
No throttling: takes about 445ms to load and on 340ms the loading state comes in
First when I started building the page I didn't care that much about suspense just used switch and show.
I also thought for some reason that I would be able to access user().services for example and I thought I would have multiple suspenses?
In general I find this topic little confusing so if Anyone could guide me I would be thankful.
