- Hands-On RESTful Web Services with Go
- Naren Yellavula
- 177字
- 2021-06-24 17:04:23
Old and new methods of data flow in SPA
In the traditional flow of serving requests, the order looks like this:
- The client requests a web page from the server
- The server authenticates and returns a rendered response
- Every rendered response is in HTML with embedded data
With SPAs, however, the flow is quite different:
- Request the HTML templates with the browser in one single go
- Then, query the JSON REST API to fill a model (the data object)
- Adjust the UI according to the data in the model (in JSON)
- From the browser, push back the changes to the server via an API call
In this way, communication happens only in the form of the REST API. The client takes care of logically representing the data. This causes systems to move from Response-Oriented Architecture (ROA) to Service-Oriented Architecture (SOA). Take a look at the following diagram:
SPAs reduce bandwidth usage and improve site performance. SPAs are a major boost for API-centric server development because now a server can satisfy requirements for both browser and API clients.
推薦閱讀
- Python機器學習經典實例
- Mastering Drupal 8 Views
- Expert Data Visualization
- Java EE 7 Performance Tuning and Optimization
- C/C++程序員面試指南
- Spring Boot+Vue全棧開發實戰
- Maker基地嘉年華:玩轉樂動魔盒學Scratch
- 計算機應用技能實訓教程
- 深度實踐KVM:核心技術、管理運維、性能優化與項目實施
- 數據分析與挖掘算法:Python實戰
- 奔跑吧 Linux內核
- 從零開始學Python大數據與量化交易
- 虛擬現實建模與編程(SketchUp+OSG開發技術)
- C#從入門到精通(微視頻精編版)
- Mastering Web Application Development with Express