3 points · by isuckatcoding · 10y ago · 1 comment
Why can't web crawlers index websites as efficiently as a website that is the traditional server side rendered website?
Is it just a matter of inefficiency for the crawler to wait for JS to load the UI? Aside from doing some kind of hybrid approach of client-server rendering, what can web apps that are SPA do to increase visibility?
Search engines index content first and usually discard what javascript renders - that is why people are told never to use Document.Write() to render text, however tempting it may be.
Now there is a difference between using Document.Write() to output text to a HTML document and using something like JQuery which for most cases would only influence how text within elements is to be rendered. If javascript was disabled on a website properly using JQuery, a search engine would still see the content within the elements, whereas on a page using DOM manipulation like the Document.Write function the rendered content would still be hidden because the function can't be executed.
As search engines often take page loading speed into account to render their results pages and rank websites it is advised to put the JS at the end, when the content has already been loaded and transform its presentation later.