HACKER Q&A
📣 servytor

Would an Elixir/Phoenix LiveView be crawled better than a React SPA?


Just wondering if anyone has any experience in the crawling/SEO experience between the two.


  👤 bluehatbrit Accepted Answer ✓
It of course depends how you build it, but generally speaking yes. On the initial request liveview will fetch all the data and populate the page and send it down so you're getting a completely normal HTML experience with all the information you'd expect, the websocket only kicks in afterwards to begin doing all the data updates and such.

A react, vue, angular, or ember SPA will not display anything useful on that initial HTML response. Instead it'll need the JS to load which will then make all the other API calls required to populate the web page.

This is one of the huge benefits of liveview, you get that initial render and all that initial state. If for some reason the websocket won't connect afterwards, you still have the page with all the information requested meaning SEO isn't impacted at all. The one thing to watch out for though, is that crawlers won't open a websocket connection, so if there's anything sent down the websocket which isn't provided by the initial response that won't be seen.

I suspect this is the same with Hotwire for Rails, and the python one as well.