What I have:
- A static server authentication area implemented as described here
- An interactive server rest of the app with
App.razorconfigured like this:
...
...<HeadOutlet @rendermode="RenderModeForPage" /></head><body><Routes @rendermode="RenderModeForPage" /><script src="_framework/blazor.web.js"></script><script src="@Assets["lib/bootstrap/dist/js/bootstrap.min.js"]"></script></body></html>@code{ [CascadingParameter] private HttpContext HttpContext { get; set; } = default!; private IComponentRenderMode? RenderModeForPage => HttpContext.Request.Path.StartsWithSegments("/Auth") ? null : new InteractiveServerRenderMode(prerender: false); --> prerender:false make the blank screen appear before rendering the page components}- Authentication area has its own layout which uses
MainLayout
Every time I navigate between these 2 areas (ex: from Login page to Counter page) a blank white screen is shown for 2-5 seconds (depending of what calls I make in OnInitializedAsync - db calls etc.) before the actual page start to be rendered --> this behavior (the blank page part) is produced by new InteractiveServerRenderMode(prerender: false); --> prerender:false from App.razor
With no (prerender: false) - those 2-5 seconds in navigation between areas show the current page that was rendered before I click for navigation to other page, though the link is changed to the the one where I navigate to.
The main thing is that navigation between these 2 different rendering mode areas generates this behavior.
Is this a normal thing? Am I doing something wrong? A kind of similar thing was reported here