How Mobile Service Backend Achieved Lightning‑Fast Performance with HTTP/2 and Async Caching
This article details the Mobile Service “秒开” project’s three‑step performance optimization, covering data‑driven monitoring, HTTP/2 features like header compression and multiplexing, long‑connection architecture with WebSocket, and an asynchronous caching component that together dramatically improve response times and reliability for mobile clients.
What is the Mobile Service “秒开” Project?
The project aims to optimize the overall performance of the Mobile Service platform by improving user experience through a three‑step approach: data‑driven (performance data visualization), global evaluation (overall performance assessment), and detailed segment optimization (targeted improvements across client, server, and H5 front‑end).
Performance Governance
Effective performance governance avoids blind optimization by establishing full‑link monitoring, defining core metrics, and displaying them on a dedicated dashboard to quantify improvement targets.
HTTP/2 Enhancements
By adopting HTTP/2, the service leverages header compression (static dictionary, dynamic fields, Huffman coding) achieving up to 80% reduction in header size and overall payload reduction of about 70%.
Multiplexing and connection reuse split data into multiple binary frames over a single TCP connection, lowering client network cost and increasing server throughput, with Android request latency improving ~32% and iOS ~20%.
Long‑Connection (WebSocket) Architecture
The long‑connection service uses a publish‑subscribe model built on WebSocket, separating responsibilities into three services: IO service (maintains connections and heartbeats), registration service (service discovery), and worker service (business logic processing).
Action types include control, configuration, and data actions such as CLEAR_CACHE, CONFIG_UPDATE, DATA_UPDATE, DATA_PUSH, and SEND_MESSAGE, enabling real‑time configuration pushes and event notifications.
Application Scenarios
Real‑time configuration distribution uses long‑connection combined with Apollo to push config changes instantly, while driving‑event real‑time push can either directly push data via DATA_PUSH or trigger client‑side updates via DATA_UPDATE.
Asynchronous Cache Design
The async cache component extends the existing interface layer: on cache hit it returns cached data but continues processing the request in the background, asynchronously updating the cache after the response.
Integrating long‑connection pushes (WebSocket + DATA_PUSH) ensures the latest data reaches the client instantly, improving response speed without sacrificing data freshness.
Optimization Results
Applying the async cache to the fleet‑list interface reduced payload from 169 KB to ~45 KB (≈70% compression). Similar gains were observed for command‑distribution interfaces, demonstrating the effectiveness of the combined HTTP/2, long‑connection, and async cache strategies.
Conclusion
The comprehensive methodology—data‑driven monitoring, HTTP/2 optimization, long‑connection architecture, and asynchronous caching—significantly enhanced the Mobile Service platform’s performance, providing a practical reference for other mobile backend teams.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
G7 EasyFlow Tech Circle
Official G7 EasyFlow tech channel! All the hardcore tech, cutting‑edge innovations, and practical sharing you want are right here.
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.
