Server-Side Script Execution for Web Latency Reduction
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Client-side scripting in web transactions leads to increased latency due to network round-trip times and serial execution of requests, causing user frustration and server overhead, as client devices wait for dynamic content and execute function calls sequentially.
Innovation Solution
A web server device identifies and executes client-side scripts with synchronous function calls before transmitting the web document, embedding the results into the document, allowing the client device to render content without executing these calls, thereby reducing server load and improving user experience.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If client-side scripts are executed on the client device to retrieve dynamic content, then the web page can display dynamic information, but the latency increases due to network round-trip times and serial execution
Solution Approach 1:
The server executes client-side scripts and retrieves dynamic content before transmitting the web document to the client device. By performing the script execution and data retrieval in advance (preliminary action), the server eliminates the need for the client device to wait for network round-trips during rendering, thus reducing latency while maintaining dynamic content capability
Solution Approach 2:
The server creates a copy of the client-side execution environment and runs the scripts on the server side. Instead of the client device executing the scripts and waiting for responses, the server executes a copy of the same script logic, obtains the dynamic content, and embeds it directly in the web document, thereby eliminating network latency for the client
2Adaptability or versatility
If client-side scripts make multiple requests for dynamic content, then the web page can incorporate comprehensive dynamic information, but the number of transactions increases and server overhead increases
Solution Approach 1:
The server merges multiple separate script execution and content retrieval operations into a single unified process. Instead of handling multiple discrete client requests, the server executes all necessary client-side scripts and retrieves all required dynamic content in one batch during the initial web document generation, reducing the number of transactions and improving server processing efficiency
Solution Approach 2:
The server performs all dynamic content retrieval operations in advance before the client device receives the web document. By completing all necessary data fetching and script execution upfront, the server eliminates the need for subsequent client-side requests, thereby reducing the total number of transactions and lowering server overhead
Data Source
AI summary
An example embodiment may involve receiving, by a web server device and from a client device, a request for web content. The example embodiment may also involve determining, by the web server device, that a web document includes a script containing a synchronous client-side function call matching pre-determined criteria. The web content may be at least in part derivable from the web document. The example embodiment may also involve executing, by the web server device, the synchronous client-side function call to obtain output data. The example embodiment may also involve modifying, by the web server device, the web document to include the output data in a data structure associated with the synchronous client-side function call. The example embodiment may also involve transmitting, by the web server device and to the client device, the web document as modified.


