Last active
July 17, 2017 08:37
-
-
Save motephyr/16c764802e6dcab6b567561fd99d3a64 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
目標:盡可能讓使用者使用上覺得迅速。 | |
改進點:資料下載量少,下載速度快、反應速度快。 | |
Single Page Application: | |
優點 | |
1.更好的用户体验,让用户在web app感受native app的速度和流畅, | |
2.於第一次載入時將html,css,js等預先載入, | |
其後只需透過ajax(非同步載入)方式做資料的傳輸,資料傳輸量較少,只需取得資料即可展現畫面 | |
反應速度較快。 | |
3.畫面由前端產生,減少server渲染畫面的負擔。 | |
然而,單純只使用SPA的做法會遇到以下兩個部分: | |
1.SEO問題 | |
2.頁面在第一次載入較久 | |
為了解決以上兩點問題此時我們可有配套的做法: | |
1. Server side render (第一次載入事先為其渲染頁面) | |
or Prerender (為seo事先為其渲染頁面) | |
2. code-splitting (程式碼分割) | |
分段載入頁面相關的代碼 | |
改善資料下載速度的部分: | |
mobile-first | |
OptimizeImages. | |
針對image採用lazy-loading的策略 | |
(landing page不要用SPA<---這個就不用說了。) | |
補註: | |
landing page不要用SPA這件事補述一下。 | |
landing page如果是靜態內容比較多的話,spa用處不大,而且的確會比較慢。 | |
landing page如果是含有常常變動的資料的話,就比較需要SEO的處理+ssr,那其實直接回傳這個頁面的內容相對單純。 | |
建議用SPA的畫面佈局: | |
http://flatfull.com/themes/note/images/main.png | |
這種佈局左邊內容固定 右邊跟著選定的功能去做畫面的變動。 | |
比如說針對購物網站都有的 "分類,購物車,訂單,我的設定" 再加上特有的功能 "收藏,上架,動態通知" | |
就比較適合。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment