Skip to content

Single Page App

aka SPA

Benefits of SPAs

  • instant feedback (after slower load)
  • converting site to a PWA easier
  • transition to mobile apps is easier (same backend code)

Examples of sites using a SPA

  • Spotify
    • navigate around and click around and look at what else to play
    • while the music plays in the background
    • music doesn't get cut off when you click on the artist
  • Gmail
  • Google Maps
  • Google Drive

When should you use a SPA?

Problem with SPAs

  • data is loaded on a as-needed basis
    • tons of loading spinners
  • SEO
    • Google can read static sites better/faster
  • the pit of success of SPAs is small
    • easy to mess up
  • the best SPAs can provide the best app-like app

Probably shouldn't be the default way we write sites


Last update: 2023-04-24