The rise of Single Page Applications (SPA) in Web Mobile

Limited connectivity is one of the main challenges in web mobile. The stateless nature of http causes that  content  and associated static files like scripts or images be transmitted over the wire every time a page is fully refreshed (assuming http caching is not implemented correctly). Diverse techniques have emerged over the years to solve part of that problem by using the browser AJAX support. One of these techniques, which drastically changed the way we develop web applications is know as single page applications.

A single page application design assumes that good part of the website layout is fixed and there are a few placeholders for showing dynamic content. The layout and associated files can be download once, and the rest can be dynamically changed using AJAX calls to a backend Web API.    

There are also a few improvements that can be made like caching all the static content and associated files, and use client templates to remove all the overhead involved with downloading html markup on every AJAX call. By using client templates (e.g. JQuery templates, JSRender, Mustache) , only the data (usually JSON data) is negotiated with the backend, and the templates can be cached as static content as well.

In the area of web mobile, it is pretty important to optimize the use of the available bandwidth to support scenarios where the connectivity is very unreliable or limited data plans are used. This is exactly where single page applications make a lot of sense. As this kind of application makes a heavy use of javascript for DOM manipulation, it might not be ideal for all kind of mobile devices (the device should support DOM manipulation and XHR).

I personally think this kind of architecture for a web application will become a common norm now that we have devices with web support everywhere.

4 Comments

  • I believe SPA is *Single* Page Application, not Simple! ;)

  • That's correct. Not sure what I was thinking when I wrote this post :). Thanks for letting me know.

  • It’s hard to find knowledgeable people on this topic, but you sound like you know what you’re talking about! Thanks

  • It's going to be interesting how much it takes off - I've recently used knockout.js in a fairly significant SPA, though this was actually due to technology constraints rather than it being a requirement.

    I think that the desire for more app-like sites using HTML5 features will probably push more people in this direction as well, though I think that there still needs to be better tooling support. I've not had chance to play with the VS11 stuff too much yet, but I hope it will be a step in the right direction.

Comments have been disabled for this content.