I was just curious about what others are doing with simple pages.
For instance we can let “about page” be a dead view and “contact us” page to be a live view.
For reducing memory usage, but loosing the smooth page navigation.
Static page can be cached, so 404 and other error pages can be made DeadView.
Can we have something like SvelteKit, where we just write it as LiveView, but can mark certain pages as DeadView?
So that the page will have server side rendering, but no socket connection.
However if need arises, we can just remove that spec and page will become LiveView again!
That way we won’t have to choose between the controller and LiveView approach, we just gravitate towards the LiveView side for any page building, and Controllers side for API!!
In Svelte Kit, you can mark certain pages Static or the whole site static. So they have the option of setting few pages static, which in turn doesn’t hydrate in the front end, thereby speeding up the initial load and stuff!
P.S.
Options like:
-
render: once (For content that gets fetched at runtime.)
-
render: static (For content that is fixed at compile time, i.e. Nimble Publisher or just local db or git source, Which will essentially make Phoenix a static site generator!!)