The method of delivering content to a browser has continued to evolve over the years. In the early days, every page was a full payload. If you clicked a link, you got a new page. If you hit the back button, you were delivered a new full page.
It didnâ€™t take long for â€śweb appsâ€ť to emergeÂ thatÂ took the AJAX approach to the next level where every aspect of the app was â€śajax-ified.â€ť Â These web apps became known asÂ Single Page Applications (SPAs).
Apps like Gmail and Google Maps felt like desktop applications in the browser. This was a great user experience: once the web application loaded, it was fully interactive without loading another page in the browser. And thereâ€™s the rub…
The next phase in content delivery became a hybrid approach. The initial page load was fully formed HTML that the browser could receive and display. The page loaded faster and was functional upon being presented to the user. â€śBut what about all that AJAXy web app goodness,â€ť you ask? Well, part two of this hybrid process is to backfill the interactivity that we have grown used to and expect. The page is loaded and functional, then all of the AJAX interactions are added to enhance the experience for the user. This gave us the best of both worlds and that’s how many sites and web apps work today.
- SEO: Pages are searchable when they firstÂ load.
- Perceived performance: page loads fast and interactivity is available immediately.
- Actual performance: initial page load is typically lighter; additional requests are only made to enhance the experience.
- Better developer experience: single language codebase with better maintainability and less context switching; shared code; shared tooling.
All of this adds up to being the best of all worlds.
Despite all these advantages, Node.js isnâ€™t the best solution for all needs. Tasks that require intensiveÂ computation are better suited for other languages. But the Node.js platform handles most typical web applications nicely.