Since your server basically returns a blank page, crawlers have no way to index your content. There are some ways to fix this problem, but it requires additional code and maintenance issues.
- Stateful URLs
This is an issue that can be solved if taken enough consideration, but that many SPAs still suffer from. In an ideal world I would be able to copy the current URL and send it to a friend, and expect that friend to see the same content as me. However, if your app handles state changes without modifying the URL, then the whole URL concept breaks down.
On the old days, the request-response cycle was always the same:
- A client requests a route.
- The route is matched to a controller.
- The controller fetches one or more models from the database.
- The view is rendered with those models.
Now days we can't even talk about MVC client-side. There is such a mess of patterns, concepts, and terminology that we have just opted for naming MV* anything that somehow separates data from presentation. This whole mess of concepts and abstractions means more things to keep in mind while developing, and more things to track down while debugging.
There is a new trend picking up strength in the web development world: Isomorphic Apps. The core idea is pretty simple: create applications that can be rendered both client-side and server-side with little or no code changes.
In the rest of this post I will explain how to build it.