HTTP/2 Server Push Implementation and Performance Optimization by Tencent CDN
Tencent CDN’s implementation of HTTP/2 Server Push predicts and preloads dependent resources via link tags or headers, creates PUSH_PROMISE frames, and streams assets before the main response, yielding measurable latency reductions on real‑world pages when used with proper sizing, priority, and cache awareness, while avoiding slow‑start and buffer issues.
HTTP/1.x served the internet well, but as the web evolved, its performance became a bottleneck. In 2015, IETF released HTTP/2, which brings significant improvements including binary transmission, header compression, multiplexing, and Server Push. While most CDN vendors now support HTTP/2, many omit the Server Push feature, likely due to nginx open-source version not supporting it. Tencent CDN has completed HTTP/2 Server Push support with detailed performance testing.
Server Push Principle: When a server receives a client's main request, it can "predict" the dependent resources needed by the main request and proactively push these resources to the client concurrently with the main response. This allows the client to retrieve dependent resources from local cache "without delay" after parsing the main response, reducing latency and improving user experience.
Implementation Methods:
1. Identifying Dependent Resources: Using W3C Candidate Recommendation standard - either static <link> tags or HTTP headers with "preload" keyword:
<link rel="preload" href="push.css" as="style">
Or:
Link: <push.css>; rel=preload; as=style
The "nopush" attribute indicates the browser may already have the resource cached:
Link: </app/script.js>; rel=preload; as=script;nopush
2. Pushing Resources: Three methods: client-specified push, CDN node configuration, or origin server specifying via Link header.
3. Architecture: CDN Server Push flow: (a) Predict dependent resources based on request headers or configuration; (b) Send PUSH_PROMISE frame to browser before main response; (c) Create new HTTP/2 stream for pushed resources.
Performance Analysis:
Push is beneficial when size(HTML) < BDP (Bandwidth-Delay Product). Compared to Resource Inlining in HTTP/1.1, Server Push allows resources to be cached independently by the browser.
Use Case Considerations:
1. TCP Slow Start: Push may not improve performance when congestion window is small
2. Resource Loading Priority: Pushing low-priority resources before high-priority ones can worsen performance
3. Kernel Buffer: Large pushed resources can fill the send buffer, blocking high-priority responses
4. Browser Cache: Pushing already-cached resources wastes bandwidth
Real-world Testing: Tests on Tencent News and Tencent Customer Service pages show significant performance improvements when pushing appropriate resources (JS, CSS, small images) at the right time. Pushing large files without priority consideration does not help reduce latency.
Recommendations: Push appropriate resources at appropriate times; migrate to HTTP/2 with requests consolidated under the same domain; avoid pushing resources stored in browser cookies; consider using QUIC for priority-based push resource differentiation; future AI analysis may enable intelligent push strategies.
Tencent Cloud Developer
Official Tencent Cloud community account that brings together developers, shares practical tech insights, and fosters an influential tech exchange community.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.