Difference between clientside and serverside (ajax) rendering for search page, concerning SEO [closed]

StackOverflow https://stackoverflow.com/questions/18161855

Question

I'm working on a page that is more or less a search tool, it basically consists of an input field, and it will show a list of entries to the user, according to the input. In this situation, if there any difference for SEO if the page uses client or server-side rendering (using AJAX) and why?

I'm just concerned if it's a disadvantage if I use client-side rendering in this particular scenario.

I understand that client-side rendering is a disadvantage for SEO compared to server-side - when the HTML is complete at the beginning, so to say. But in a dynamic case, where the results have to be loaded asynchronously anyways, is it still a disadvantage? Does it depend if the current content can be mapped to a URL?

Was it helpful?

Solution 2

Since you don't seem to be much concerned with UI/UX and want to know more about SEO, I'd suggest to go with the client side. Anything that's dynamically loaded after user's input won't be visible to web crawlers.

However, another approach would be to make it work both ways - so that by visiting a specific URL (site.com/search?q=something) you get the page fully rendered from the server side, while you're still able to make another search that will happen at the client side. You'd still have a little trouble indexing all the relevant searches, but perhaps you could track the last x searches and show them somewhere on the page, with links to full server-side rendered search pages, like the one I mentioned above. You can even make those dynamic calls not only change the content of the page, but the URL hash in the browser's address bar as well (see here).

That way you'd provide users with a nice user interface/experience, while still doing a very nice SEO job since the crawlers would be able to index the links from the list of last searches.

So, to directly answer your question: client-side vs. server-side page rendering - huge SEO difference

OTHER TIPS

AJAX loading of content has no impact on SEO.

The updating of the DOM via JavaScript will not result in any noticeable changes in what is indexed by a search bot. Almost all legitimate search engines archive the non-dynamic version of a webpage.

In order to enable SEO you have to maintain embedded links to non-dynamic versions of that content.

For example (using jQuery):

 <div class="next-page"><a class="ajax-me" href="/page-2.html">Page 2</a></div>

 $(document).ready(function(){
    $(".ajax-me").click(function(e){
        e.preventDefaults();
        $('#ajax-target').load($(this).attr("href"));
    });
 });

That will enable AJAX for links, but still make that link visible to the web crawler for search engines.

Your server will have to know to respond with either a full webpage or AJAX response based upon the header request.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top