Method and apparatus for increasing subresource loading speed
First Claim
1. A method for increasing subresource loading speed, the method comprising:
- receiving a page request initiated by a user;
extracting a host domain name corresponding to a page URL (Uniform Resource Locator);
querying if a hash table has a domain name tree corresponding to the host domain name;
in an instance when the hash table has the domain name tree corresponding to the host domain name, traversing the domain name tree corresponding to the host domain name and extracting a plurality of subresource domain names with a highest priority, and at a same time, establishing TCP (Transmission Control Protocol) connections for the host domain name and the plurality of subresource domain names;
when a main document data of the host domain name is received, resolving the main document data and initiating a subresource loading request according to a subresource URL in the main document data;
in an instance when the subresource domain name in the subresource loading request is a domain name in the plurality of subresource domain names, directly initiating a HTTP (Hypertext Transfer Protocol) request by using the established TCP connections of the plurality of subresource domain names, and completing the loading of the subresource and wherein, after the subresource loading request is initiated, the method further comprises;
querying the domain name tree corresponding to the host domain name, in an instance when the domain name tree corresponding to the host domain name does not contain the subresource domain name in the subresource loading request, creating a node in the domain name tree corresponding to the host domain name to store the subresource domain name, and initializing the priority of the subresource domain name according to a resource type of the subresource; and
in an instance when the domain name tree corresponding to the host domain name contains the subresource domain name in the subresource loading request, updating the priority of the subresource domain name according to the resource type of the subresource.
2 Assignments
0 Petitions
Accused Products
Abstract
Provided are methods and apparatus for increasing subresource loading speed. A method may include receiving a page request initiated by a user, extracting the host domain name corresponding to the page URL, and querying if the hash table has a domain name tree corresponding to the host domain name; if the hash table has a domain name tree corresponding to the host domain name, traversing the domain name tree to extract a plurality of subresource domain names with the highest priority, and at the same time, establishing TCP connections for the host domain name and the plurality of subresource domain names; when the main document data of the host domain name is received, initiating a subresource loading request according to the subresource URL in the main document data; if the subresource domain name in the subresource loading request is a domain name in the above plurality of subresource domain names, directly initiating a HTTP request by using the previously established TCP connection, and completing the loading of the subresource. By establishing TCP connections for subresource domain names with high priority in advance, such methods and apparatus solve the problem that TCP connection needs to be established on site when a subresource loading is requested.
-
Citations
20 Claims
-
1. A method for increasing subresource loading speed, the method comprising:
-
receiving a page request initiated by a user; extracting a host domain name corresponding to a page URL (Uniform Resource Locator); querying if a hash table has a domain name tree corresponding to the host domain name; in an instance when the hash table has the domain name tree corresponding to the host domain name, traversing the domain name tree corresponding to the host domain name and extracting a plurality of subresource domain names with a highest priority, and at a same time, establishing TCP (Transmission Control Protocol) connections for the host domain name and the plurality of subresource domain names; when a main document data of the host domain name is received, resolving the main document data and initiating a subresource loading request according to a subresource URL in the main document data; in an instance when the subresource domain name in the subresource loading request is a domain name in the plurality of subresource domain names, directly initiating a HTTP (Hypertext Transfer Protocol) request by using the established TCP connections of the plurality of subresource domain names, and completing the loading of the subresource and wherein, after the subresource loading request is initiated, the method further comprises; querying the domain name tree corresponding to the host domain name, in an instance when the domain name tree corresponding to the host domain name does not contain the subresource domain name in the subresource loading request, creating a node in the domain name tree corresponding to the host domain name to store the subresource domain name, and initializing the priority of the subresource domain name according to a resource type of the subresource; and in an instance when the domain name tree corresponding to the host domain name contains the subresource domain name in the subresource loading request, updating the priority of the subresource domain name according to the resource type of the subresource. - View Dependent Claims (2, 3, 4)
-
-
5. A method for increasing subresource loading speed, the method comprising:
-
extracting a host domain name in a page request; querying if a domain name tree corresponding to the host domain name exists; in an instance when a domain name tree corresponding to the host domain name exists, extracting a predetermined amount of subresource domain names from the domain name tree, and establishing TCP (Transmission Control Protocol) connections for the host domain name and the predetermined amount of subresource domain names; initiating a subresource loading request according to a subresource domain name in an obtained main document data corresponding to the host domain name; and in an instance when a subresource domain name with TCP connection established contains the subresource domain name in the subresource loading request, initiating a HTTP (Hypertext Transfer Protocol) request by using the established TCP connection corresponding to the subresource domain names, and loading the subresource and wherein, after the subresource loading request is initiated, the method further comprises; querying the domain name tree corresponding to the host domain name, in an instance when the domain name tree corresponding to the host domain name does not contain the subresource domain name in the subresource loading request, creating a node in the domain name tree corresponding to the host domain name to store the subresource domain name, and initializing the priority of the subresource domain name according to a resource type of the subresource; and in an instance when the domain name tree corresponding to the host domain name contains the subresource domain name in the subresource loading request, updating the priority of the subresource domain name according to the resource type of the subresource. - View Dependent Claims (6, 7, 8, 9)
-
-
10. An apparatus for increasing subresource loading speed, wherein the apparatus comprises:
-
a processor; a memory; a query module stored in the memory and executed by the processor, configured to receive a page request initiated by a user, extract a host domain name corresponding to a page URL (Uniform Resource Locator), and query if a hash table has a domain name tree corresponding to the host domain name; a connection establishing module stored in the memory and executed by the processor, configured to, in an instance when the hash table has the domain name tree corresponding to the host domain name, traverse the domain name tree corresponding to the host domain name and extract a plurality of subresource domain names with a highest priority, and at a same time, establish TCP (Transmission Control Protocol) connections for the host domain name and the plurality of subresource domain names; a loading request module stored in the memory and executed by the processor, configured to, when a main document data of the host domain name is received, resolve the main document data, and initiate a subresource loading request according to a subresource URL in the main document data; a loading module stored in the memory and executed by the processor, configured to, in an instance when the subresource domain name in the subresource loading request is a domain name in the plurality of subresource domain names, directly initiate a HTTP (Hypertext Transfer Protocol) request by using the established TCP connections of the plurality of subresource domain names, and complete the loading of the subresource and wherein, after the subresource loading request is initiated, the apparatus is further configured to;
query the domain name tree corresponding to the host domain name, in an instance when the domain name tree corresponding to the host domain name does not contain the subresource domain name in the subresource loading request, create a node in the domain name tree corresponding to the host domain name to store the subresource domain name, and initialize the priority of the subresource domain name according to a resource type of the subresource; andin an instance when the domain name tree corresponding to the host domain name contains the subresource domain name in the subresource loading request, update the priority of the subresource domain name according to the resource type of the subresource. - View Dependent Claims (11, 12, 13)
-
-
14. An apparatus for increasing the subresource loading speed, the apparatus comprising:
-
a processor; a memory; a query module stored in the memory and executed by the processor, configured to extract a host domain name in the page request, and query if a domain name tree corresponding to the host domain name exists; a connection establishing module stored in the memory and executed by the processor, configured to, in an instance when a domain name tree corresponding to the host domain name exists, extract a predetermined amount of subresource domain names from the domain name tree, and establish TCP (Transmission Control Protocol) connections for the host domain name and the predetermined amount of subresource domain names; a loading request module stored in the memory and executed by the processor, configured to initiate a subresource loading request according to a subresource domain name in an obtained main document data corresponding to the host domain name; and a loading module stored in the memory and executed by the processor, configured to, in an instance when a subresource domain name with TCP connection established contains the subresource domain name in the subresource loading request, initiate a HTTP (Hypertext Transfer Protocol) request by using the established TCP connection corresponding to the subresource domain names, and loading the subresource and wherein, after the subresource loading request is initiated, the apparatus is further configured to; query the domain name tree corresponding to the host domain name, in an instance when the domain name tree corresponding to the host domain name does not contain the subresource domain name in the subresource loading request, create a node in the domain name tree corresponding to the host domain name to store the subresource domain name, and initialize the priority of the subresource domain name according to a resource type of the subresource; and in an instance when the domain name tree corresponding to the host domain name contains the subresource domain name in the subresource loading request, update the priority of the subresource domain name according to the resource type of the subresource. - View Dependent Claims (15, 16, 17, 18, 19)
-
-
20. A non-transitory computer readable medium having program codes executable by the processor, wherein the program codes cause the processor to execute the following:
-
extracting a host domain name in the page request, querying if a domain name tree corresponding to the host domain name exists; in an instance when a domain name tree corresponding to the host domain name exists, extracting a predetermined amount of subresource domain names from the domain name tree, and establishing TCP (Transmission Control Protocol) connections for the host domain name and the predetermined amount of subresource domain names; initiating a subresource loading request according to a subresource domain name in an obtained main document data corresponding to the host domain name; and in an instance when a subresource domain name with TCP connection established contains the subresource domain name in the subresource loading request, initiating a HTTP (Hypertext Transfer Protocol) request by using the established TCP connection corresponding to the subresource domain names, and loading the subresource and wherein, after the subresource loading request is initiated, the program codes further cause the processor to;
query the domain name tree corresponding to the host domain name, in an instance when the domain name tree corresponding to the host domain name does not contain the subresource domain name in the subresource loading request, create a node in the domain name tree corresponding to the host domain name to store the subresource domain name, and initialize the priority of the subresource domain name according to a resource type of the subresource; andin an instance when the domain name tree corresponding to the host domain name contains the subresource domain name in the subresource loading request, update the priority of the subresource domain name according to the resource type of the subresource.
-
Specification