-
If you have routable components with rendermode webassembly it seems that the ”page” is fetched from the server for every navigation to the route. It would be good If the enhanced navigation could cache the view client side after first visit.. anyone know If that’s possible? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I was wondering about the same thing. I have an app that has a public facing side where I want to utilize SSR without any interactivity (except enhanced navigation and streaming), and an administrative UI which I decided to build completely using WASM. I noticed that even though the admin pages navigate exclusively between themselves (they are all WASM pages), each navigation still fires an XHR request to fetch the shell, and only after that WASM component fires it's XHR API requests, so each navigation has a mini waterfall that slows the app. I kind of understand that the first XHR is needed to get the shell/layout, but I would expect that there should be a way to set-up things so that the pages used in the admin layout do not depend on any server resources except the API requests. So far, I was not able to configure that without making the whole app InteractiveWebAssembly, which is not what I want for the public-facing pages. Thx! |
Beta Was this translation helpful? Give feedback.
-
Thank you so much!!! This is exactly what I needed! |
Beta Was this translation helpful? Give feedback.
-
If you render the router interactively you get client-side navigation, if you don't then you get enhanced navigation. #50769 (reply in thread) the last image shows a possible way of doing this, another is to set an attribute on the page and retrieve the endpoint, checking the metadata for the attribute. |
Beta Was this translation helpful? Give feedback.
I think in the Visual Studio template with Authentication type "Individual Accounts" (when you select Interactive render mode Webassebly global) they solved that in a way that can solve your issue. All Auth related stuff is SSR, and the rest is Webassembly (without fetch for the view). In the App.razor they have a custom Rendermode setting called "RenderModeForPage".