Mobile Best Practices: Single Page Architecture (SPA)

Overview

Single page applications refer to apps that can redraw any part of the UI without requiring a server roundtrip to retrieve HTML. The page does not automatically reload during user interaction with the application or transfer control to another page. Instead, state changes occur via JavaScript using templates and DOM manipulation.

In SPA’s the application logic is shifted from the web server to the client (device). The result is a more fluid and native-like user experience.

image

Figure 1: Single Page App Architecture Diagram. Client represents mobile device or browser.

Characteristics

Best Practices

  1. Load data locally first before going to server
  2. Handle for offline scenarios
  3. Cache Images and Resources

Benefits

Additional Reading

Single Page App Book