durandalJS is SEO friendly

I was checking out the new bits for durandalJS version 2.0 and found out that is now easier to make your Single Page Application be AJAX crawlable, for SEO purposes. Historically, crawling ajax pages were difficult to implement. Google created some specification so that you will have a way to render your “pages” when google bot crawls your pages.

shell.js

I edited shell.js such that the routing looks like this:

image

Note the bang (!) character – this was the key. Of course, we wouldn’t want the navigation title to look ugly, so I had explicitly set the title property.

The somepage.js viewmodel doesn’t change – for example:

image

The address bar looks like this – nice! It now follows the specification by Google.

image

Next Steps

Depending on your backend technology, you will have to create a special “renderer” which spits out the “near equivalent” content of your page when google bot crawls your pages by detecting the _escaped_fragment_ query parameter. Per specification, “the search engine agrees to display in the search results the corresponding pretty URLS”, so that when your “page” link gets clicked, the browser goes to the “single application page” with the proper query parameters.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer’s view in any way.
Tagged with: , ,
Posted in SPA
  • http://www.bestnindia.com/Mangalore/Restaurants Restaurants in Mangalore

    Thank you for your great Post :)