CN110769060B - Web page loading speed optimization method based on cross-domain object dependency relationship - Google Patents

Web page loading speed optimization method based on cross-domain object dependency relationship Download PDF

Info

Publication number
CN110769060B
CN110769060B CN201911032317.2A CN201911032317A CN110769060B CN 110769060 B CN110769060 B CN 110769060B CN 201911032317 A CN201911032317 A CN 201911032317A CN 110769060 B CN110769060 B CN 110769060B
Authority
CN
China
Prior art keywords
web page
direct connection
domain server
server
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911032317.2A
Other languages
Chinese (zh)
Other versions
CN110769060A (en
Inventor
黄家玮
朱海涛
刘明月
王建新
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Central South University
Original Assignee
Central South University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Central South University filed Critical Central South University
Priority to CN201911032317.2A priority Critical patent/CN110769060B/en
Publication of CN110769060A publication Critical patent/CN110769060A/en
Application granted granted Critical
Publication of CN110769060B publication Critical patent/CN110769060B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services

Abstract

The invention discloses a method for optimizing the loading speed of a Web page based on a cross-domain object dependency relationship. Aiming at the problem that the object needs to be obtained from a plurality of servers during the loading of the Web page, so that the delay is overlarge, the direct connection domain server is used for directly notifying the non-direct connection domain server to push the object to the client. The invention can reduce the connection establishment time of the client and the non-direct connection domain server, thereby reducing the Web page loading time.

Description

Web page loading speed optimization method based on cross-domain object dependency relationship
Technical Field
The invention relates to a Web page loading speed optimization method based on cross-domain object dependency relationship.
Background
In recent years, with the continuous development of computer networks, the content of Web pages has already evolved from the original textual content to complex systems comprising a plurality of servers. The web page content is more and more abundant, the time for loading the web page is prolonged due to the increase of resource types and the complexity of the resource types, and the user experience is seriously influenced.
The method includes that a browser accesses a server through an HTTP or HTTPS mode, so that an HTM L source code of a Web page to be accessed is obtained, and then other resources (objects) contained in an HTM L source code are sequentially obtained, the other objects contained in the HTM L source code are only distributed on a server which is directly connected when the Web page is accessed, and are also possibly distributed on a plurality of other servers which are not directly connected (namely, cross-domain object dependency relation).
Therefore, in order to deal with the current situation of cross-domain storage of increasingly complex resources of Web pages, the improvement of the transmission performance of the Web pages becomes a key problem.
Disclosure of Invention
In order to solve the problems, the invention provides a method for optimizing the loading speed of a Web page based on cross-domain object dependency relationship.
The technical scheme of the invention comprises the following steps:
a Web page loading speed optimization method based on cross-domain object dependency relationship comprises the following steps:
the direct connection domain server returns an HTM L source code of a corresponding Web page to the client after receiving an HTTP request for accessing the Web page by the client, determines the storage position of each object in the HTM L source code according to a uniform resource locator, and encapsulates the request information of the object and TCP connection information of the client and the direct connection domain server to generate a corresponding notification message and sends the notification message to the corresponding non-direct connection domain server if the object is stored on the non-direct connection domain server;
after receiving the notification message, the non-direct connection domain server acquires the content of the object according to the object request information in the notification message; then packaging the TCP connection information in the notification message and the obtained object content into a data packet, and sending the data packet to a requesting client;
the direct connection domain server refers to a server where an HTM L source code of a Web page requested to be accessed by a client is located, and the non-direct connection domain server refers to a server where an object in the HTM L source code is located except the direct connection domain server, namely, a server where data such as the type and the content of the object are located.
Further, after receiving an HTTP request for accessing a Web page by a client, the direct connection domain server performs operations according to the following steps:
step 11, acquiring an HTM L source code of a corresponding Web page, reading a first object in the HTM L source code, and turning to step 12;
step 12, acquiring a uniform resource locator (UR L) according to the attribute value of the current object, and turning to step 13;
step 13: judging whether an IP address (an IP address corresponding to a domain name searched by a DNS) corresponding to the domain name in the uniform resource locator of the current object is an IP address of the local direct connection domain server (the domain name is not the domain name of the local direct connection domain server) so as to judge whether the current object is stored on the local direct connection domain server, if not, turning to the step 14, otherwise, turning to the step 15;
step 14: packaging the request information and TCP connection information of the current object, generating corresponding notification information, sending the notification information to the non-direct connection domain server where the current object is located, and turning to step 15; the TCP connection information refers to the connection information between the client and the local direct connection domain server and comprises a source IP address, a source port, a destination IP address, a destination port, a serial number and an acknowledgement number;
step 15, judging whether the current object is the last object in the HTM L source code, if so, ending, otherwise, turning to step 16;
step 16, read the next object in the HTM L source code and go to step 12.
Further, in step 13, if it is determined that the current object is stored in the local direct connection domain server, the object is directly pushed to the client, and the process goes to step 15.
Further, after receiving the notification message of the direct connection domain server, the non-direct connection domain server operates according to the following steps:
step 21: analyzing the notification message;
step 22: acquiring object request information and TCP connection information in the notification message, and acquiring the type and content of a corresponding object;
step 23: and encapsulating the TCP connection information in the notification message and the acquired object type and content into a data packet, and pushing the data packet to the requesting client.
Further, the non-direct connection domain server receives the notification message of the direct connection domain server through the monitor program.
Further, in step 23, encapsulating the TCP connection information in the notification message and the acquired object type and content into a data packet, specifically: the source IP address and the destination IP address of the data packet are respectively set as a destination IP address and a source IP address in the notification message TCP connection information, the source port and the destination port of the data packet are respectively set as a destination port and a source port in the notification message TCP connection information, the sequence number of the data packet is set as an acknowledgement number in the notification message TCP connection information, and the acknowledgement number of the data packet is set as the value of the sequence number in the notification message TCP connection information plus 1. The source IP address, the destination IP address, the source port and the destination port are set to be opposite to those in the original TCP connection information so as to disguise a data packet from the direct connection domain server to the client; and according to the specification of the TCP connection protocol, a sequence number and an acknowledgement number are set so as to ensure normal TCP connection. And then sending the encapsulated data packet to the requesting client.
Has the advantages that:
aiming at the problem that the delay is overlarge due to the fact that resources need to be obtained from a plurality of servers (domains) during the loading of a Web page, the direct connection domain server notifies the non-direct connection domain server of an object request message, and the non-direct connection domain server actively pushes the object (resource) to the client, so that the TCP connection establishing time is shortened, the page loading speed is optimized, and the user experience is improved.
Drawings
Fig. 1 is a flowchart illustrating an operation of a direct connection domain server according to an embodiment of the present invention.
Fig. 2 is a flowchart illustrating an operation of a non-direct connection domain server according to an embodiment of the present invention.
Fig. 3 is a test scenario network topology diagram.
Fig. 4(a) is a schematic diagram of a page loading process under the HTTP protocol, and fig. 4(b) is a schematic diagram of a page loading process after improvement. HTTP + is the technical scheme of the invention.
Fig. 5 shows the variation of the Web page loading time in the scenario of different network delays. HTTP + is the technical scheme of the invention.
Fig. 6 shows the variation of the Web page loading time in the scenario of different network bandwidths. HTTP + is the technical scheme of the invention.
Fig. 7 shows changes in Web page loading time in a scenario where the total number of objects included in a Web page is different while bandwidth delay and the like are kept unchanged. HTTP + is the technical scheme of the invention.
Fig. 8 shows changes in the web page loading time in different scenes of the proportion of resources in the non-direct connection domain to the page, under the condition that the bandwidth delay and the total number of page objects are not changed. HTTP + is the technical scheme of the invention.
FIG. 9 shows the loading time of a 50-quantile object in a Web page with bandwidth delay and the total number of page objects and their proportions remaining unchanged. HTTP + is the technical scheme of the invention.
FIG. 10 shows the loading time of a 90-quantile object in a Web page with bandwidth delay and the total number of page objects and their proportions remaining unchanged. HTTP + is the technical scheme of the invention.
Detailed Description
The invention will be further described with reference to the accompanying drawings.
Referring to fig. 1 and 2, the flow of the present embodiment is as follows:
for the embodiment, the main part of the operation is divided into two parts, including a direct connection domain server and a non-direct connection domain server.
After receiving an HTTP request of a client for accessing a Web page, the direct connection domain server operates according to the following steps:
the method comprises the steps of obtaining an HTM L source code of a corresponding Web page, reading a first object in the HTM L source code as a current object, obtaining a uniform resource locator (UR L) value corresponding to the current object to judge whether the object is an object on a local direct connection domain server, if so, directly reading other objects in the HTM L source code until the last object in the HTM L source code without any processing, or directly pushing the object to a client, then sequentially reading other objects in the HTM L source code until the last object in the HTM L source code, if not, packaging information of the object and TCP connection information, generating a corresponding notification message, sending the notification message to a non-direct connection domain server, and then sequentially reading other objects in the HTM L source code until the last object in the HTM L source code.
For a non-direct connection domain server, firstly, monitoring information sent by the direct connection domain server to obtain object request information and TCP connection information; then obtaining the type (the object type is the information needed to be contained in the data packet) and the content of the corresponding object on the local computer; and packaging the acquired TCP connection information, the type and the content of the object into a data packet, and pushing the data packet to a client. The source address and the destination address of the data packet are respectively set as the destination address and the source address of an original TCP connection (referring to the TCP connection between the client and the direct connection domain server), the source port number and the destination port number of the data packet are respectively set as the destination port number and the source port number of the original TCP connection, the sequence number of the data packet is set as the acknowledgement number of the original TCP connection, and the acknowledgement number of the data packet is set as the value of the sequence number of the original TCP connection plus 1.
The invention utilizes the WANem network simulation platform to simulate different conditions in the network. The operating system used by the client is Windows 10. The client uses a Google browser, the version of which is chrome 73. The operating system used by the direct connection domain server is at Centos7.4, with a version of Nginx 1.14.0 deployed. The operating system used by the non-direct connection domain server is Ubuntu16.04, with a version of Nginx 1.14.0 deployed. The Network tool in the Google browser Development is used to record the whole process of Web page loading. Meanwhile, for the loading completion time of the objects with different quantiles in the page and the completion time of each object, a modified TimeMeasure plug-in is used, and the plug-in can obtain the starting request time and the corresponding loading completion time of each object in the Web page. The experimental network topology mainly comprises a client and two servers, and the environment of the local area network is simulated through a WANem network simulation platform. The initial default of this experiment sets up network delay to 300ms, and the bandwidth sets up to 10Mbps, and page quantity is 50, and wherein the proportion of resources in the non-direct connection domain server is 70%. The network delay range is set at 100ms to 500ms and the bandwidth range is set at 0.1Mb to 100Mb during the experiment. For the page structure tested in the experiment, the number of page objects ranges from 10 to 100, wherein the proportion of the objects of the non-direct connection domain ranges from 30% to 100%.
Fig. 3 is a network topology diagram of the experiment, which is a simulation of different conditions in the network by using the WANem network simulation platform to measure the experimental effect of the invention in different scenes.
Fig. 4(a) is a schematic diagram of a Web page loading process under an HTTP protocol, in which a client establishes a TCP connection with a non-direct-connected domain server after receiving an HTM L source code file returned by a direct-connected domain server and analyzing an object included in an HTM L source code file, and finally sends an object request to the client, and the Web page loading cannot be completed until the object content of the non-direct-connected domain server is received, fig. 4(b) is an improved scheme of the present invention.
Fig. 5 shows the variation of the web page loading time under different network delay scenarios. The experimental bandwidth is set to be 100Mbps, the number of pages is 50, and the proportion of resources (objects) in the non-direct connection domain server is 70%. The network delay varies from 100ms to 500 ms. It can be seen from the figure that the optimization effect of the HTTP + of the scheme of the invention is more and more obvious with the continuous increase of network delay;
fig. 6 shows the variation of the web page loading time in the scenario of different network bandwidths. Setting the experimental network delay to be 300ms and the number of pages to be 50, wherein the proportion of resources in the server of the non-direct connection domain is 70%. The bandwidth varies from 0.1Mbps to 10 Mbps. Under the condition of changing the network bandwidth, the webpage loading speed is increased by about 25% -30%.
Fig. 7 shows changes in Web page loading time in a scenario where the total number of objects included in a Web page is different while bandwidth delay and the like are kept unchanged. Setting the experimental network delay to 300ms, setting the network bandwidth to 100Mbps, and setting the proportion of resources in the non-direct connection domain server to 70%. The number of pages is from 10 to 100. The invention can reduce 46% of webpage loading time at most by applying the optimization result.
Fig. 8 shows changes in the web page loading time in different scenes of the proportion of resources in the non-direct connection domain to the page, under the condition that the bandwidth delay and the total number of page objects are not changed. Setting the experimental network delay to 300ms, setting the network bandwidth to 100Mbps and setting the number of pages to 50. The proportion of resources in the non-direct connection domain server is 30% to 100%. It can be seen from the figure that as the number of resources in the non-direct connection domain increases gradually, the optimization effect is gradually improved, and the optimization effect reaches 37% optimally.
Fig. 9 and 10 show the loading times of a 50-quantile object and a 90-quantile object in a Web page, respectively, with the bandwidth delay and the total number of page objects and their proportions remaining unchanged. The network delay is set to 300ms, the bandwidth is set to 10Mbps, the number of pages is 50, and the proportion of resources in the server in the non-direct connection domain is 70%. The trends of the two are consistent overall, because the resources of the non-direct connection domain are uniformly distributed in the page, and the accelerating effect is achieved on the objects with different quantiles. Under the condition that the total number of the page objects is gradually increased, the page acceleration effect is stabilized at about 20 percent.

Claims (5)

1. A Web page loading speed optimization method based on cross-domain object dependency relationship is characterized by comprising the following steps:
the direct connection domain server returns an HTM L source code of a corresponding Web page to the client after receiving an HTTP request for accessing the Web page by the client, determines the storage position of each object in the HTM L source code according to a uniform resource locator, and encapsulates the request information of the object and TCP connection information of the client and the direct connection domain server to generate a corresponding notification message and sends the notification message to the corresponding non-direct connection domain server if the object is stored on the non-direct connection domain server;
after receiving the notification message, the non-direct connection domain server acquires the content of the object according to the object request information in the notification message; then packaging the TCP connection information in the notification message and the obtained object content into a data packet, and sending the data packet to a requesting client;
the direct connection domain server is a server where an HTM L source code of a Web page requested to be accessed by a client is located, and the non-direct connection domain server is a server except the direct connection domain server where an object in the HTM L source code is located.
2. The method for optimizing the loading speed of the Web page based on the cross-domain object dependency relationship as claimed in claim 1, wherein the direct connection domain server operates according to the following steps after receiving an HTTP request for accessing the Web page from a client:
step 11, acquiring an HTM L source code of a corresponding Web page, reading a first object in the HTM L source code, and turning to step 12;
step 12: acquiring a uniform resource locator according to the attribute value of the current object, and turning to step 13;
step 13: judging whether the IP address corresponding to the domain name in the uniform resource locator of the current object is the IP address of the server of the local direct connection domain, so as to judge whether the current object is stored on the server of the local direct connection domain, if not, turning to the step 14, otherwise, turning to the step 15;
step 14: packaging the request information and TCP connection information of the current object, generating corresponding notification information, sending the notification information to the non-direct connection domain server where the current object is located, and turning to step 15; the TCP connection information refers to the connection information between the client and the local direct connection domain server and comprises a source IP address, a source port, a destination IP address, a destination port, a serial number and an acknowledgement number;
step 15, judging whether the current object is the last object in the HTM L source code, if so, ending, otherwise, turning to step 16;
step 16, read the next object in the HTM L source code and go to step 12.
3. The method for optimizing the loading speed of the Web page based on the cross-domain object dependency relationship as claimed in claim 2, wherein in step 13, if it is determined that the current object is stored in the local direct-connected domain server, the current object is directly pushed to the client, and the process goes to step 15.
4. The method for optimizing the loading speed of the Web page based on the cross-domain object dependency relationship as claimed in claim 1, wherein the non-direct-connection domain server operates according to the following steps after receiving the notification message of the direct-connection domain server:
step 21: analyzing the notification message;
step 22: acquiring object request information and TCP connection information in the notification message, and acquiring the type and content of a corresponding object;
step 23: and encapsulating the TCP connection information in the notification message and the acquired object type and content into a data packet, and pushing the data packet to the requesting client.
5. The method for optimizing the loading speed of the Web page based on the cross-domain object dependency relationship as claimed in claim 1, wherein the non-direct-connection domain server receives the notification message of the direct-connection domain server through a listener.
CN201911032317.2A 2019-10-28 2019-10-28 Web page loading speed optimization method based on cross-domain object dependency relationship Active CN110769060B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911032317.2A CN110769060B (en) 2019-10-28 2019-10-28 Web page loading speed optimization method based on cross-domain object dependency relationship

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911032317.2A CN110769060B (en) 2019-10-28 2019-10-28 Web page loading speed optimization method based on cross-domain object dependency relationship

Publications (2)

Publication Number Publication Date
CN110769060A CN110769060A (en) 2020-02-07
CN110769060B true CN110769060B (en) 2020-07-31

Family

ID=69334276

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911032317.2A Active CN110769060B (en) 2019-10-28 2019-10-28 Web page loading speed optimization method based on cross-domain object dependency relationship

Country Status (1)

Country Link
CN (1) CN110769060B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104850560A (en) * 2014-02-18 2015-08-19 北京京东尚科信息技术有限公司 Method and system for loading business data in webpage in real time
CN108964975A (en) * 2018-05-30 2018-12-07 北京五八信息技术有限公司 Cross-domain access processing method and device
CN110020278A (en) * 2017-09-08 2019-07-16 阿里巴巴集团控股有限公司 Displaying, providing method, client and the server of page data

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10664546B2 (en) * 2017-12-08 2020-05-26 Facebook, Inc. Techniques for URL archiving while browsing a web page

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104850560A (en) * 2014-02-18 2015-08-19 北京京东尚科信息技术有限公司 Method and system for loading business data in webpage in real time
CN110020278A (en) * 2017-09-08 2019-07-16 阿里巴巴集团控股有限公司 Displaying, providing method, client and the server of page data
CN108964975A (en) * 2018-05-30 2018-12-07 北京五八信息技术有限公司 Cross-domain access processing method and device

Also Published As

Publication number Publication date
CN110769060A (en) 2020-02-07

Similar Documents

Publication Publication Date Title
EP3229148B1 (en) Website access method and device, and website system
CN112073405B (en) Webpage data loading method and device, computer equipment and storage medium
CN108256114B (en) Document online preview method and device, computer equipment and storage medium
US20120192080A1 (en) Tailoring content based on available bandwidth
US20140082154A1 (en) File sharing method, terminal and relay server
WO2014063550A1 (en) Method and system for microblog resource sharing
CN107689976B (en) File transmission method and device
WO2021007752A1 (en) Return-to-source method and related device in content delivery network
US8868638B2 (en) Methods for reducing latency in network connections using automatic redirects and systems thereof
CN103516785A (en) Web page proxy system and communication method thereof
Singh et al. Flexiweb: Network-aware compaction for accelerating mobile web transfers
CN103139252B (en) The implementation method that a kind of network proxy cache is accelerated and device thereof
CN111756674A (en) Network communication method, system, device and computer readable storage medium
WO2024021405A1 (en) Data transmission system and method
CN101699823B (en) Method for realizing caching resource in curl library
CN109194706B (en) Network resource dial testing method and terminal
CN112954013B (en) Network file information acquisition method, device, equipment and storage medium
CN110769060B (en) Web page loading speed optimization method based on cross-domain object dependency relationship
WO2017185632A1 (en) Data transmission method and electronic device
CN108810070B (en) Resource sharing method and device, intelligent equipment and storage medium
CN103561068A (en) Method and device for improving speed of web page browsing
CN101257501B (en) Data leading-in method, system as well as Web server
US9729650B2 (en) Providing data to a network terminal
CN106664223B (en) Method and device for detecting number of shared access hosts
CN114915565A (en) Method and system for debugging network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant