How are we supposed to leverage InteractiveServer ? #53466
Replies: 3 comments 13 replies
-
Let me try and clarify this a bit
When using |
Beta Was this translation helpful? Give feedback.
-
@DavidThielen
Also this "prerendering" only takes place when the user initially starts the application (by entering its URL) or when the developer calls This might not answer your question directly but hopefully gives a little more insight into the inner workings. |
Beta Was this translation helpful? Give feedback.
-
You still get to see the content faster than if you render a page, download the script, negotiate the connection and start a new circuit. One is doing 2 steps (initial request + db query) vs 4 steps (initial request, script, negotiate, websocket, db query), it's physically impossible for it to be faster. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
According to @javiercn (thank you for the feedback) in this post, the purpose of
InteractiveServer
is to get as much of the page up as quickly as possible from the first call toOnInitializedAsync()
, and then on the second call, then populate the page with the data in the DB.This way the user gets a page in under ½ second. All the lists and grids are empty, all the fields have prompts but no data. But the page framework is displayed as they wait for it to be populated.
Ok, great idea. Except...
According to this (also asked here - no answer yet), it may not be called twice. It may only call
OnInitializedAsync()
once. This means on any call toOnInitializedAsync()
, I must read the DB and build a fully populated page.Which brings me back to my original question - what is the value/purpose of
InteractiveServer
? It may change how Blazor builds & renders a page. But there is no change on the programming side, except we lose cascading parameters.And it means it will take longer to deliver the final page because when
OnInitializedAsync()
is called twice, then all those DB calls are called twice and that's slower.To sum up, I understand and agree with your point that there's value in delivering a data free page very quickly. I just don't see how
InteractiveServer
delivers that. Can you please explain how this delivers the empty page faster? (I can see how you could do it if OnInitializedAsync() was always called twice - but it isn't.)??? - thanks - dave
Beta Was this translation helpful? Give feedback.
All reactions