????????????????????????Javascript??????UI?????????????7?????????????????????????????????????????????????????????????????
????Javascript?????????????????????????????????????????????????÷?Χ??????????????????????????????????????????????????????????????????????????棬??????????????????????γ?????????
????????????????web?????о?????e??????????????????????????????????????????????????????????????????????
????JavaScript?????????????history??navigation??page rendering ??????????????????
?????????????????????????????????????????????????HTML???
????Single Page Applications (SPAs) ??????????δ?????????
???????????????Web??????????????????????????????? ??????????????????
????????????JS??????? ??? ????Ч????????Web????У??????? ??? ????????
???????????????PJAX????TurboLinks??????????
????????????????????Щ?????????Щ????????????????????????(UX)???棬????????С?????????????????? ???? ????????????????????Javascript?? ???? ??÷???????????????????????????????δ??????????
????Server???????????????
????????????????????
????????????????
????????????????????????
??????????history???????
??????????????
??????????
????1. Server???????????????
????TL;DR: ?????????????SEO?????????????????????????????????????????????????????????????????????????API??????????????????????????HTTP2.0??????PUSH of resources.
????????????????????????????????????”server-rendered apps” ?? “single-page apps”?????????????????????????????????????????????????κ????????????????????????????????????????????????????????????????????????????????????????????????Stuart Cheshire?и??????? (????????2??)??“It’s the latency?? stupid” :
????The distance from Stanford to Boston is 4320km.
????The speed of light in vacuum is 300 x 10^6 m/s.
????The speed of light in fibre is roughly 66% of the speed of light in vacuum.
????The speed of light in fibre is 300 x 10^6 m/s * 0.66 = 200 x 10^6 m/s.
????The one-way delay to Boston is 4320 km / 200 x 10^6 m/s = 21.6ms.
????The round-trip time to Boston and back is 43.2ms.
????The current ping time from Stanford to Boston over today’s Internet is about 85ms (…)
????So: the hardware of the Internet can currently achieve within a factor of two of the speed of light.
??????????????????????·??????85ms???????????????????????????????????????????????????????????????????????????????????????????????????????? 50ms ???????????
???????仰????????????????????????????????????·?????????????????????????????????????????????????????????????????????????·????????????????????????????????????????????????
???????????Javascript??????Web???????????????????????????Щ??????<body>???????????????У????<script>??<link>??????????”Single Page Applications”????”SPA”?????????????????????????????????????????????????棬??????????????????????????????????
?????????????????????????????????????http://app.com/orders/?????????????????????????????????????????????????????? ??? ?????????????????????磬????????????????????????????????????????????????檔????????????SPA?????????ο??????????????????<script>????????棬?????????????????????????????????????


?????1. ????????????SPA????????????????
 

??????????????????????????????????? ???紫????? ?????????????????????Σ????淴??????cache?????????????γ???????????????????????????????????Σ???????????????????????????????????????????????????????????????????棩??????????????????????????
?????????????????cache?????????????е????????????????????????“Is jQuery Too Big For Mobile?” ???????????????????????jQuery??????Щ????????????????
???????????????????????????????????????Ч?????????????????????????????????????????????汻???????????????????????檔
????????????????????????????????Э??TCP ???? ???????
?????????????????????TCP????????????????????????????????SSL????????????????????????????????session??????????????????????????Щ????????????????????????????????????????仰?????С?????????????????????????????????????????????????????????
??????Σ?TCPЭ???????????????????????? slow start????????????????????????????????(segments)??С????????????


?????2. ??????????TCP???????????????????δ?С(KB)

???????SPA?????????????
??????????????????????????????????????е???????Google??Ilya Grigorik?????????“High Performance Browser Networking” ?????????“4??????(…)????????????????????????????64KB????????????????”????????????????????????????????????????????????????????TCP???????????????????????225ms??
????????????????????????????Ч??????????????????????????÷????????Paul Irish?????????“Delivering the Goods”???????????????Web??????? 14kb ????????????
?????????????????????????????????????????????????layout????????????????????????????????????????????????????????????????????Javascript????????????????????????????????????????????????Щ?????????????????????????????????????CDN??????????????????????о??????????
????????????????????????????????????????????????????????????????????ó?????????????????“????????潻?????????????”??????????顣???Щ????£?????????????????????????????????????????????????з????????????????????????е???????????
???????磬?е???????????”??”??淵??????????????????????????????????????????????????????????????????????£????????н?????????????е?????? “??????????????????” ????????????????
????????????????????????session???????URL???????????????з??????????????????????????????????з????????????/orders???URL?????????????????”??”???????????????????????????????????CSS???????з???????????“????????”??“???????????”???????????????Javascript?????????????????????? ???? ????????? ??????????????????????????