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網頁應用程式設計
部署程式
|
169
這麼一來,瀏覽器就能知道該以何種方式解壓縮這份回應資訊。眾所周知,利用 Gzip
壓縮資料能夠減低網路傳輸時間,但並沒有太多人知道 Gzip 實際的壓縮率有多少。一
般來說,Gzip 的壓縮率可達到 70% 左右。這樣優異的壓縮表現,能大幅提昇網頁載入
資源的速度。
通常我們會在伺服器端設定哪些類型的檔案需要用 Gzip 壓縮。一般會建議至少要對純
文字格式的回應資料進行 Gzip 壓縮,像是 HTMLJSONJavaScript,以及樣式表…
等。如果是已經壓縮過的檔案類型(像是圖檔和 PDF 檔),就不應該再用 Gzip 壓縮,
因為再壓縮一次也不見得能讓檔案變更小。
每種網頁伺服器設定 Gzip 的方式都不盡相同,如果用的是 Apache 2.x 或更新的版本,
就會需要用到 mod_deflate 模組(
http://httpd.apache.org/docs/2.0/mod/mod_deflate.html
)。
如果用的是其他的網頁伺服器,就得自行研讀它們隨附的說明文件。
善用 CDN
內容分派網路(content delivery network,簡稱 CDN),能夠幫網站派送一些靜態的網頁
內容,藉此降低載入這些內容所需花費的時間。使用者的電腦和網頁伺服器之間的距離
長短,會影響到載入網頁內容需花費的時間。CDN 會幫你把網頁內容分別部署到位於世
界各地的伺服器,如此一來,當使用者發出載入資源的請求時,CDN 就能挑選一台離使
用者最近的伺服器(理論上會在相同的國家)來派送網頁資源 ...
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