性能对比:单服务器Keep-Alive与公共CDN哪个页面加载更快?
Page Load Performance: Self-Hosted vs. CDN Setups (With Hard Data)
Great question about page load performance tradeoffs! Let’s walk through the concrete comparisons and data points from Ilya Grigorik’s High Performance Browser Networking to make this clear:
1. Self-Hosted + Keep-Alive
- Setup: All HTML and JavaScript resources are served from your single own server, using Keep-Alive connections to cut down on redundant TCP/TLS handshakes between the browser and server.
- Measured load time: 228ms
2. Self-Hosted HTML + Public CDN for JavaScript
- Setup: HTML comes from your server, but JS files are hosted on a public CDN. While you gain CDN perks like edge caching and geographically closer servers, the downside is needing to establish multiple new TCP connections (and their associated handshakes) with the CDN’s servers.
- Measured load time: 284ms
- Key overhead: The 56ms gap between this setup and the first one is exactly the extra TCP handshake time required for the CDN connections.
3. Self-Hosted + Keep-Alive + HTTP Pipelining (Optimized)
- Setup: Build on the first setup by adding HTTP pipelining—this lets the browser send multiple requests over a single Keep-Alive connection without waiting for each response first.
- Measured load time: 172ms
- This is the fastest option because it eliminates both redundant handshakes and reduces request round-trip delays.
All performance numbers come from testing documented in Ilya Grigorik’s High Performance Browser Networking.
内容的提问来源于stack exchange,提问作者Ahmed Sonbaty
相关产品推荐
相关产品推荐

