1. Trang chủ >
  2. Công Nghệ Thông Tin >
  3. Kỹ thuật lập trình >

Chapter 1. The Rise of JavaScript Web Apps

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (1.75 MB, 21 trang )

creating a poor initial user experience. Page load times ultimately

impact a company’s “bottom line.” Both Amazon.com and Wal‐

mart.com have reported that for every 100 milliseconds of improve‐

ments in their page load, they were able to grow incremental reve‐

nue by up to 1%.

In 2010, Twitter released a new and re-architected version of its site.

This “#NewTwitter” pushed the UI rendering and logic to the Java‐

Script running in the user’s browser. For its time, this architecture

was groundbreaking. However, within 2 years, Twitter.com released

a re-re-architected version of their site that moved back the render‐

ing to the server. This allowed Twitter to drop the initial page load

times to 1/5th of what they were previously. Twitter’s move back to

server-side rendering caused quite a stir in the JavaScript commu‐

nity. What Twitter.com and many others soon realized was that

client-side rendering has a very noticeable impact on performance.

The First KBs Are Essential

The biggest weakness in building client-side web apps

is the expensive initial download of large Javascript

files. TCP (Transmission Control Protocol), the pre‐

vailing transport of the Internet, has a congestion con‐

trol mechanism called slow-start, which means data is

sent in an incrementally growing number of segments.

Ilya Grigorik, in his book High Performance Browser

Networking (O’Reilly) explains how it takes “four

roundtrips and hundreds of milliseconds of latency, to

reach 64 KB of throughput between the client and

server.” Clearly, the first few KBs of data sent to the

user are essential to great user experiences and page


The rise of client-side JavaScript applications that consist of no

markup other than a

Tải bản đầy đủ (.pdf) (21 trang)