Dynamic Chunk Hosting for Runtime-Selective Webpage Loading
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing webpage loading technologies inefficiently download and execute supplementary code chunks due to a lack of runtime usage information during the build-time bundling process, leading to unnecessary retrieval of non-required code units.
Innovation Solution
Implement dynamic chunk hosting (DCH) and dynamic sourcemap hosting, where client-side applications generate combined SCPU requests, and server-side applications process and respond to these requests, retrieving and integrating only the required SCPUs and sourcemap references dynamically.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of manufacture
If build-time bundling strategies are used to group SCPUs into chunks, then code organization and reusability are improved, but the ability to adapt to runtime usage patterns is lost, causing unnecessary code retrieval
Solution Approach 1:
The system transitions from static build-time bundling to dynamic runtime bundling. The JavaScript runtime dynamically determines which SCPUs to bundle into chunks based on actual usage patterns, dependency graphs, and configuration options. This allows the bundling strategy to adapt flexibly to different runtime conditions rather than being fixed at build time.
Solution Approach 2:
The system performs preliminary analysis of dependency graphs and usage patterns during runtime initialization, then uses this information to pre-bundle relevant SCPUs into chunks before they are actually needed. This preliminary preparation reduces the overhead of subsequent dynamic bundling operations.
2Loss of substance
If dynamic code chunk retrieval is implemented, then bandwidth consumption is reduced by loading only necessary code, but system complexity increases due to runtime bundling mechanisms
Solution Approach 1:
The JavaScript runtime performs self-service bundling by automatically analyzing dependency graphs, identifying required SCPUs, and creating appropriate chunks without external intervention. The runtime monitors its own execution patterns and makes intelligent decisions about which code to bundle and when, eliminating the need for complex external bundling systems.
Solution Approach 2:
The system implements feedback mechanisms where execution patterns and usage data are continuously monitored and fed back into the bundling decision-making process. This feedback loop enables the system to learn from actual runtime behavior and optimize future bundling decisions, reducing unnecessary code retrieval over time.
3Productivity
If runtime-based SCPU bundling is implemented, then code retrieval efficiency is improved by loading only required units, but execution speed decreases due to dynamic bundling overhead
Solution Approach 1:
The system performs preliminary bundling operations during initialization or idle periods, creating ready-to-execute chunks that can be immediately loaded when needed. This advance preparation eliminates the need for slow runtime bundling operations during critical execution paths, maintaining high execution speed while achieving efficient code retrieval.
Solution Approach 2:
The system segments the codebase into small, granular SCPUs that can be independently bundled into minimal chunks. This fine-grained segmentation allows the runtime to retrieve only the exact code needed for current operations, reducing both retrieval overhead and execution time by avoiding loading unnecessary code segments.
Data Source
AI summary
Described herein is a computer implemented method. The method includes receiving a plurality of requests for separable computer program units (SCPUs) from a first computer program, the plurality of requests including at least a first request for a first SCPU and a second request for a second SCPU. In response to determining that the first request and the second request are to be combined, a combined SCPU request is generated based on the first request and the second request. The combined SCPU request is sent to a remote server and in response a combined SCPU response that includes at least the first SCPU and the second SCPU is received. The first SCPU and the second SCPU are provided to the first computer program.


