Seven, SSR (server-side rendering)

The use of framework

Download Vue.js

Execution Vue.js

Generate HTML pages (the first screen display, depending on vue.js load)

No previous front-end frame, padding data with the server side jsp / php, is sent to the client has been filled with a good HTML data. The first screen is no problem

Nigeria now, using JQuery asynchronous load data, and using React Vue front-end framework, but is waiting to load up the framework, the first screen only shows the first screen rendering problems, the first screen performance will decline. So it is necessary to find ways to optimize the fold in vue.js level.

Multi-level optimization

  • Construction of template compilation layer. vue2.0 Vue will split into two packages compile and runtime, when webpack build, unify all template projects related template syntax when building compiled into runtime code that can be executed. During the execution of the browser, you do not need to carry out the process template compilation.
  • Independent of the data page to be a prerender. User marketing page, users see all the pages are the same, so this page will build layer fully implemented in the fall, render out, straight out of a generation of HTML. Then the browser does not need vue.js.
  • Server-side rendering. Users like the center of this page, to get this personal data in the service center side, the server will render out this page, then the browser get is straight out of HTML, the browser can be directly rendered page.

 

 

Reproduced in: https: //www.cnblogs.com/QianDingwei/p/11037826.html

Guess you like

Origin blog.csdn.net/weixin_34268610/article/details/93264808