Book Image

KNOCKOUTJS BLUEPRINTS

By : Carlo Russo
Book Image

KNOCKOUTJS BLUEPRINTS

By: Carlo Russo

Overview of this book

Table of Contents (12 chapters)
KnockoutJS Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Working to make the app SEO crawlable


If you think that making an SPA crawlable should be hard to accomplish, it's time to change your mind.

If you look at the documentation of DurandalJS you can find how to make the application crawable (at least, from Google Search).

For this section, we are going to follow the guide at: http://durandaljs.com/documentation/Making-Durandal-Apps-SEO-Crawlable.html.

The first step should be the modification of our page to contain the fragment meta tag.

Add the following code inside the head tag of index.html:

<meta name="fragment" content="!">

For the second step, we need to use a server-side application to give a different answer based on query string parameters.

The specifications tell you how to give a full snapshot of the page when you get a request with _escaped_fragment_ inside the query string.

You can find many solutions out there, but depending on the website complexity you can choose between two different paths:

  • Pre-render the pages and save them to...