MatinDevs
Link Prefetching in LiveView, like Next.js?
I’m currently experimenting with Phoenix LiveView, and that looks really promising. As a person who has worked with .NET Blazor for a long time, LiveView isn’t something comparable to Next.js, yet. But it’s some truth about it that made me really fall in love with this framework: Simplicity.
Nevertheless, There’s one feature that is really simple to set up in some front-end web frameworks, like Next and Remix; and that is Link Prefetching. When a link becomes visible in the DOM, the browser fetches it before the user has clicked on it, so it will “Feel” snappier from the user’s perspective. Of course, only the skeleton of the page will be loaded, and things like DB fetch and other heavy stuff that we put in tag in React (and show the user a skeleton of the page instead), will not be loaded at prefetching.
My question is this: is doing such a thing possible in Phoenix LiveView?
Marked As Solved
greven
Hey, I agree this would be pretty good to have in Phoenix LiveView, but because of the way LiveView works It is a non-trivial implementation with many gotchas. You can follow a discussion on the Phoenix suggestions forum section about this here:
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








