Batched Script Downloads in Component-Based Ajax Architectures
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In high latency environments, the repeated issuance of XHR calls to load module dependencies in an Ajax framework results in significant delays during Web page loading, as each module is requested individually, leading to inefficiencies in the rendering process.
Innovation Solution
A method and system for optimized downloading of scripts in a component-based architecture, which involves identifying module dependencies, generating a dependency graph, and requesting all unloaded modules in a single XHR request, with the dependency graph being updated as each module is loaded, allowing for efficient rendering of pages without constant page refreshes.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If multiple XHR calls are issued to load module dependencies individually, then each module can be loaded as needed, but significant delays occur during Web page loading in high latency environments
Solution Approach 1:
The patent combines multiple individual XHR calls into a single batched XHR request. The system collects all required module dependencies and sends them in one consolidated request to the server, which returns all modules in a single response. This merging approach eliminates the sequential waiting time between multiple individual requests, directly resolving the contradiction between ensuring complete module loading and reducing page loading time.
Solution Approach 2:
The system performs preliminary analysis of module dependencies before initiating the XHR request. By pre-processing the dependency graph and identifying all required modules in advance, the system can prepare a complete batched request that includes all necessary modules. This preliminary action ensures that no additional follow-up requests are needed, thereby reducing total loading time while maintaining reliability.
2Reliability
If a complete re-rendering of the Web page is performed for every data exchange, then data synchronization between browser and server is maintained, but user experience deteriorates due to constant page refreshing
Solution Approach 1:
The patent segments the page update process into two distinct parts: the Web page structure (HTML) and the data content (JSON). By separating these concerns, the system can update only the data portion through Ajax requests without triggering a complete page re-render. This segmentation allows data synchronization to be maintained while avoiding the disruptive full page refreshes that harm user experience.
Solution Approach 2:
The patent introduces an intermediary layer (the Ajax framework with JSON data exchange) between the server and the Web page rendering. Instead of the server directly triggering full page re-renders, data is exchanged through this intermediary in a structured format that can be selectively integrated into the existing page. This mediator enables data synchronization without requiring complete page refreshes, thus preserving user experience.
3Extent of automation
If individual XHR calls are used to load each module dependency, then precise control over module loading is achieved, but network latency is amplified due to repeated requests
Solution Approach 1:
The patent merges multiple individual module loading requests into a single batched XHR call. The system maintains precise control over which modules are loaded by constructing a dependency graph and identifying required modules, but executes the loading operation as one consolidated network request. This approach preserves the automation and precision of individual module selection while eliminating the cumulative network latency of repeated sequential requests.
4Ease of operation
If Ajax technology is used to exchange small bits of information without page refreshing, then user experience is improved, but the complexity of implementing module dependency management increases
Solution Approach 1:
The patent implements self-service mechanisms where the system automatically analyzes module dependencies, generates the batched XHR requests, and updates the dependency graph without requiring manual intervention. The dependency graph serves as a self-managing data structure that automatically tracks which modules have been loaded and which are still required. This automation reduces the perceived complexity for users while maintaining the benefits of Ajax technology.
Solution Approach 2:
The system employs feedback mechanisms through the dependency graph that automatically updates as modules are loaded. Each successful module load provides feedback that is recorded in the dependency graph, which then uses this information to determine the next set of required modules. This feedback loop automates the dependency management process, making it more manageable despite the increased complexity introduced by Ajax technology.
Data Source
AI summary
Embodiments of the present invention address deficiencies of the art in respect to module dependency loading in an Ajax environment, and provide a novel and non-obvious method, system and computer program product for the optimized downloading of Javascript in a component based architecture. In an embodiment of the invention, a method for optimized downloading of scripts in a component-based architecture can be provided. The method can include identifying a set of module dependencies for a script embedded in a page received for rendering, locating the module dependencies in a dependency graph for the script, determining from the dependency graph a subset of the module dependencies that have yet to be loaded for the page, requesting each module in the subset in a single request, and loading each requested module in conjunction with rendering the page.

