- Full-Stack Vue.js 2 and Laravel 5
- Anthony Gore
- 164字
- 2021-07-02 19:57:15
Server-side rendering
Server-side rendering is a great way to increase the perception of loading speed in full-stack apps. Users get a complete page with visible content when they load your site, as opposed to an empty page that doesn't get populated until JavaScript runs.
Say we have an app built with components. If we use our browser development tool to view our page DOMafterthe page has loaded, we will see our fully rendered app:
<p id="app"> <ul> <li>Component 1</li> <li>Component 2</li> <li> <p>Component 3</p> </li> </ul> </p>
But if we view the source of the document, that is, index.html,as it was when sent by the server, you'll see it just has our mount element:
<p id="app"></p>
Why? Because JavaScript is responsible for building our page and, ipso facto, JavaScript has to run before the page is built. But with server-side rendering, our index file includes the HTML needed for the browser to build a DOM before JavaScript is downloaded and run. The app does not load any faster, but content is shown sooner.
- Node.js Design Patterns
- Flutter開發實戰詳解
- JavaScript語言精髓與編程實踐(第3版)
- Microsoft Dynamics 365 Extensions Cookbook
- Visual Basic程序設計教程
- Web開發的貴族:ASP.NET 3.5+SQL Server 2008
- WSO2 Developer’s Guide
- Full-Stack Vue.js 2 and Laravel 5
- Learning Python by Building Games
- AutoCAD 2009實訓指導
- SQL Server 2008 R2數據庫技術及應用(第3版)
- 區塊鏈架構之美:從比特幣、以太坊、超級賬本看區塊鏈架構設計
- Java Web開發實例大全(基礎卷) (軟件工程師開發大系)
- IPython Interactive Computing and Visualization Cookbook
- Java語言程序設計實用教程(第2版)