Skip to Content
JAVASCRIPT網頁應用程式設計
book

JAVASCRIPT網頁應用程式設計

by Alex MacCaw
January 2013
Intermediate to advanced
332 pages
5h 23m
Chinese
GoTop Information, Inc.
Content preview from JAVASCRIPT網頁應用程式設計
第十章
部署程式
學習如何以正確的方式部署網頁應用程式,其重要性並不亞於學習如何開發程式;試
想,如果歷盡千辛萬苦開發出全新版本的 Facebook,但實際上線後發現它用起來慢得不
得了,這叫人情何以堪呢!每位使用者都會希望網站用起來能夠又快又穩(而且不要動
不動就掛掉)。部署 JavaScript HTML 檔案,聽起來似乎很容易(畢竟它們不過只是
一些靜態的檔案嘛!)但其實裡面還是隱含了不少的學問。而且這也往往是在開發網頁
應用程式時,最容易被忽略的環節。
還好,目前已有一些歷經無數人反覆測試、驗證的技術和做法,可協助我們以最正確的
方式來部署程式。基本上,所有的 JavaScript 應用程式,甚至是所有和網頁相關的靜態
檔案,都應該要採用本章介紹的做法來部署。只要確實遵循本章的建議,相信一定能讓
你順利的交付出效能優異的網頁應用程式。
效能
提昇效能最簡單直接的做法之一,就是減少 HTTP 請求數量。每一組 HTTP 請求,裡面
都包含了許多的表頭(header)資訊,以及 TCP 固定成本(overhead)。儘可能將連線
數量降至最低,可以加快使用者載入網頁的速度。同理,和伺服器間的傳輸資料量,也
會顯著的影響載入網頁的速度。因此,讓網頁本身,以及網頁所需用到的所有檔案保持
精簡,可說是降低網路傳輸時間(這也正是每個網頁應用程式,最大的效能瓶頸所在)
的不二法門。
只要將多個 script 檔案或 CSS 檔案合併成一個,就能減少產生網頁的過程中所需用到的
HTTP 連線數量。合併檔案的動作可以在部署階段或執行階段進行。如果選擇在執行階段 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

初めてのJavaScript 第3版 ―ES2015以降の最新ウェブ開発

初めてのJavaScript 第3版 ―ES2015以降の最新ウェブ開発

Ethan Brown, 武舎 広幸, 武舎 るみ
PHP编程:第4版

PHP编程:第4版

Kevin Tatroe, Peter MacIntyre
Strange Code

Strange Code

Ronald T. Kneusel
Perfecting Your Thinking Skills

Perfecting Your Thinking Skills

MIT Sloan Management Review

Publisher Resources

ISBN: 9789862766811