4 ms·
You could use something like Phantom JS. To iterate a point in the article, a number of client-heavy sites built on Angular and Ember have been rendering their
by williamcotton 13y ago
You could use something like Phantom JS.
To iterate a point in the article, a number of client-heavy sites built on Angular and Ember have been rendering their content on the server-side to be presented to crawlers like the Googlebot for SEO purposes.
- michaelwww 13y agoI understand node.js with V8 and also Phantom JS but how does a client browser view the DOM rendered on the server is what I'm asking. I'm guessing it gets rendered and serialized to JSON for transport, but I could be over-thinking it. Server side rendering is the same as it ever was, just with new tools.
- hackerboos 13y ago>I understand node.js with V8 and also Phantom JS but how does a client browser view the DOM rendered on the server is what I'm asking. It's returned in the request as HTML if the USER_AGENT matches Googlebot just like it would in a normally non-SPA web app.
- michaelwww 13y agoThen I don't understand the problem with SEO because we can feed the crawlers whatever HTML is relevant for search engines
- williamcotton 13y agoThe issue is that frameworks like Angular and Ember generate markup AFTER the HTTP GET response has been returned. If a crawler executes the web page without a full Javascript context it will miss out on the intended content.