CN112433784A - Page loading method, device, equipment and storage medium - Google Patents

Page loading method, device, equipment and storage medium Download PDF

Info

Publication number
CN112433784A
CN112433784A CN202011457388.XA CN202011457388A CN112433784A CN 112433784 A CN112433784 A CN 112433784A CN 202011457388 A CN202011457388 A CN 202011457388A CN 112433784 A CN112433784 A CN 112433784A
Authority
CN
China
Prior art keywords
page
target
access
paging
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.)
Pending
Application number
CN202011457388.XA
Other languages
Chinese (zh)
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.)
Dongguan Mengda Plasticizing Science & Technology Co ltd
Original Assignee
Dongguan Mengda Plasticizing Science & Technology Co ltd
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 Dongguan Mengda Plasticizing Science & Technology Co ltd filed Critical Dongguan Mengda Plasticizing Science & Technology Co ltd
Priority to CN202011457388.XA priority Critical patent/CN112433784A/en
Publication of CN112433784A publication Critical patent/CN112433784A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Abstract

The application relates to a page loading method, a page loading device, page loading equipment and a storage medium. The method comprises the following steps: acquiring an access request of a client for a target page; when the access request is determined to include asynchronous request information, sending an html code corresponding to the list content of the target paging to the client; the asynchronous request information is used for expressing that Ajax asynchronous loading operation needs to be carried out on the target paging; and when the access request does not comprise asynchronous request information, sending html codes corresponding to the whole content of the target paging to the client. The method can improve the page loading speed, does not influence the use of a search engine, and ensures that ranking data of the website in the search engine is not influenced.

Description

Page loading method, device, equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a page loading method, apparatus, device, and storage medium.
Background
With the continuous development of internet technology, various websites multiply as if the websites were bamboo shoots in spring after rain, and the client can access the websites in a corresponding page loading manner.
In a traditional page loading mode, a client triggers a page loading request to a server, and the server receives and processes the page loading request and then returns a new hypertext Markup Language (HTML) page to the client. Therefore, when the page is switched each time, the server needs to regenerate a new HTML page to the client, and the loading speed of the page is slow.
Disclosure of Invention
Based on this, it is necessary to provide a page loading method, apparatus, device and storage medium for the technical problem that the conventional page loading method is slow in loading.
In a first aspect, an embodiment of the present application provides a page loading method, including:
acquiring an access request of a client for a target page;
when the access request is determined to include asynchronous request information, sending an html code corresponding to the list content of the target paging to the client; the asynchronous request information is used for expressing that Ajax asynchronous loading operation needs to be carried out on the target paging;
and when the access request does not comprise asynchronous request information, sending html codes corresponding to the whole content of the target paging to the client.
In a second aspect, an embodiment of the present application provides a page loading method, including:
sending an access request aiming at the target paging to a server;
when the access request comprises asynchronous request information, receiving html codes corresponding to the target paging list content sent by the server, and updating the current paging list content according to the html codes corresponding to the list content; the asynchronous request information is used for indicating that the target paging needs to be subjected to asynchronous loading operation;
and when the access request does not include asynchronous request information, receiving html codes corresponding to the whole content of the target paging sent by the server, and loading the whole content of the target paging according to the html codes corresponding to the whole content.
In a third aspect, an embodiment of the present application provides a page loading apparatus, including:
the acquisition module is used for acquiring an access request of a client aiming at a target page;
the first sending module is used for sending the html code corresponding to the list content of the target paging to the client when the access request is determined to include asynchronous request information; the asynchronous request information is used for indicating that the target paging needs to be subjected to asynchronous loading operation;
and a second sending module, configured to send, to the client, an html code corresponding to the entire content of the target page when it is determined that the access request does not include asynchronous request information.
In a fourth aspect, an embodiment of the present application provides a page loading apparatus, including:
the sending module is used for sending an access request aiming at the target paging to the server;
a first receiving module, configured to receive, when the access request includes asynchronous request information, an html code corresponding to list content of the target page sent by the server; the asynchronous request information is used for indicating that the target paging needs to be subjected to asynchronous loading operation;
the first processing module is used for updating the current paged list content according to the html code corresponding to the list content;
a second receiving module, configured to receive, when the access request does not include asynchronous request information, an html code corresponding to the entire content of the target page sent by the server;
and the second processing module is used for loading the whole content of the target paging according to the html code corresponding to the whole content.
In a fifth aspect, an embodiment of the present application provides a page loading device, including a memory and a processor, where the memory stores a computer program, and the processor implements, when executing the computer program, the steps of the page loading method provided in the first aspect of the embodiment of the present application and the steps of the page loading method provided in the second aspect of the embodiment of the present application.
In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the page loading method provided in the first aspect of the embodiment of the present application and the steps of the page loading method provided in the second aspect of the embodiment of the present application.
According to the page loading method, the page loading device, the page loading equipment and the storage medium, after the access request of the client for the target page is obtained, when the access request includes asynchronous request information, the html code corresponding to the list content of the target page is sent to the client; and when the asynchronous request information is determined not to be included in the access request, sending html code corresponding to the whole content of the target page to the client. When the Ajax asynchronous loading operation needs to be carried out on the target paging, the server only sends html codes corresponding to the list content of the target paging to the client, and repeated rendering of the public content of the list paging by the server is avoided, so that the response performance of the server is improved, and the page loading speed is further improved. When Ajax asynchronous loading operation is not required to be performed on the target page, for example, the search engine crawler pays attention to complete html codes and content information, for the situation, the access request does not contain asynchronous request information, and the server can return html codes corresponding to the whole content of the target page to the client, so that the search engine can conveniently extract information content from the html codes. The technical scheme provided by the embodiment of the application not only improves the page loading speed, but also does not influence the use of the search engine, and ensures that ranking data of the website in the search engine is not influenced.
Drawings
Fig. 1 is a system architecture diagram applicable to the page loading method provided in the embodiment of the present application;
fig. 2 is a schematic flowchart of a page loading method according to an embodiment of the present application;
fig. 3 is a flowchart illustrating an access request generation process according to an embodiment of the present application;
fig. 4 is another schematic flowchart of a page loading method according to an embodiment of the present application;
fig. 5 is a schematic flowchart of another page loading method according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a page loading apparatus according to an embodiment of the present application;
fig. 7 is another schematic structural diagram of a page loading apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a page loading device according to an embodiment of the present application.
Detailed Description
Fig. 1 is a system architecture diagram applicable to the page loading method according to the embodiment of the present application. As shown in fig. 1, the system may include: a client 10 and a web server 11. The client 10 may load each web page on the website server 11 through a browser installed thereon, thereby accessing the target website. Alternatively, the client 10 may be an electronic device having an internet function, such as a Personal Computer (PC), a smart phone, a smart watch, and a portable device, and capable of interacting with an external device or a user. Alternatively, the website server 11 may be an independent server, or may be a server cluster formed by a plurality of servers. The embodiment of the present invention is not limited to the specific form of the client 10 and the website server 11.
In the related art, for page loading of list paging, a client usually triggers a HyperText Transfer Protocol (HTTP) request to a server, and the server receives and processes the HTTP request and then returns a new HTML page to the client. Whenever the server processes an HTTP request submitted by the client, the client can only wait idle, and even if only a small data interaction is performed, the server is required to return the entire HTML page, which results in a slow loading speed of list paging. Therefore, the technical solution provided by the embodiment of the present application aims to solve the technical problems in the related art.
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions in the embodiments of the present application are further described in detail by the following embodiments in combination with the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The following description will be given by taking an execution subject as a web server (hereinafter referred to as a server) as an example:
fig. 2 is a schematic flowchart of a page loading method according to an embodiment of the present application. The embodiment relates to a specific process of how a server processes an access request of a client, and as shown in fig. 2, the method may include:
s201, obtaining an access request of a client to a target page.
For list paging, when a client requests to open a list paging, an access request is sent to a server. For example, the client may send an access request to the server in HTTP, where the access request includes a Uniform Resource Locator (URL) address of the target page.
The target page may be any page that the client needs to access in the current page. Typically, each list page in the target web site includes a page bar therein. After the client accesses the target website for the first time and enters the first list paging in the target website, the first list paging may be regarded as a current paging, and the current paging includes a paging bar. In this way, the client can select the next target page to be accessed through the page strip in the current page. After the client enters the target page, the target page is used as a new current page, and the client can select the next target page through the page strip in the new current page at this time, and so on. Taking news listing paging as an example, the client may select a target news paging from paging bars in the current news paging, and send an HTTP request to the server to obtain page data of the target news paging.
S202, when the access request is determined to include asynchronous request information, sending html codes corresponding to the list content of the target paging to the client.
The asynchronous request information is used for indicating that Ajax asynchronous loading operation needs to be carried out on the target paging. Since the common content of each list paging in the target website is not changed greatly, and only the list content is different, when the page is loaded on the list paging, in order to improve the loading speed of the page, the Ajax asynchronous loading technology can be used. However, the Ajax asynchronous loading technology needs to be implemented by a javascript program, and after the asynchronous loading technology is used in the application, the server only returns partial content of a target page and does not return the complete content of the target page, so that a search engine cannot crawl the complete data of the page, particularly a list-type page which is an important entry of detailed content, and therefore the target website is influenced to be included and ranked in the search engine.
Therefore, in order to improve the loading speed of the page and not influence the ranking data of the website in the search engine, the two cases can be distinguished. That is, in a scenario where Ajax asynchronous loading operation needs to be performed on a target page (for example, in a scenario where access operation of a client on the target page is triggered by user behavior), when the client triggers an access request, the client may carry asynchronous request information in the access request. In this way, when the server receives an access request sent by the client, the server can perform targeted processing on the access request based on whether the access request contains asynchronous request information or not. Specifically, when the server determines that the access request includes asynchronous request information, the server may render only the list content of the target page, so as to generate an html code corresponding to the list content, and return the html code corresponding to the list content to the client, so that the client performs asynchronous loading on the target page. The list content refers to the content of the target page different from the current page.
S203, when the access request does not comprise the asynchronous request information, sending html codes corresponding to the whole content of the target paging to the client.
In a scenario where the Ajax asynchronous loading operation on the target page is not required (for example, in a scenario where the access operation of the client on the target page is triggered by a search engine), when the client triggers an access request, the client does not carry asynchronous request information in the access request. In this way, when the server receives an access request sent by the client, the server can perform targeted processing on the access request based on whether the access request contains asynchronous request information or not. Specifically, when the server determines that the access request does not contain asynchronous request information, the server may perform integral rendering on the whole content of the target page, so as to generate an html code corresponding to the whole content of the target page, and return the html code corresponding to the whole content to the client, so that the client loads the whole page content of the target page, and a search engine can capture page data conveniently. The whole content includes the list content and the non-list content of the target page, and the non-list content refers to the same content in the target page and the current page, that is, the common content in each list page.
Optionally, on the basis of the foregoing embodiment, in order to enable asynchronous loading of the target page, before the foregoing S201, the method further includes: the target page is split into list content and non-list content.
The server can split a page template into a plurality of template modules in advance by using the characteristics of the traditional world wide web background template, that is, list contents (which can be understood as contents corresponding to the list template module) and non-list contents (which can be understood as contents corresponding to the non-list template module) in each page are separated. And performing conditional rendering on the list content and the whole content of the target paging by judging whether the access request sent by the client carries asynchronous request information or not. When the access request carries asynchronous request information, rendering the list content of the target paging, and only outputting html codes corresponding to the list content to realize asynchronous loading of the target paging and improve the loading speed of the page; when the access request does not carry asynchronous request information, the integral rendering is carried out on the list content and the non-list content of the target paging, the html code corresponding to the whole content of the target paging is output, and the integrity of the page is kept, so that the search engine can conveniently capture the page data.
According to the page loading method provided by the embodiment of the application, after the access request of the client for the target page is obtained, when the access request is determined to include asynchronous request information, the html code corresponding to the list content of the target page is sent to the client; and when the asynchronous request information is determined not to be included in the access request, sending html code corresponding to the whole content of the target page to the client. When the Ajax asynchronous loading operation needs to be carried out on the target paging, the server only sends html codes corresponding to the list content of the target paging to the client, and repeated rendering of the public content of the list paging by the server is avoided, so that the response performance of the server is improved, and the page loading speed is further improved. When Ajax asynchronous loading operation is not required to be performed on the target page, for example, the search engine crawler pays attention to complete html codes and content information, for the situation, the access request does not contain asynchronous request information, and the server can return html codes corresponding to the whole content of the target page to the client, so that the search engine can conveniently extract information content from the html codes. The technical scheme provided by the embodiment of the application not only improves the page loading speed, but also does not influence the use of the search engine, and ensures that ranking data of the website in the search engine is not influenced.
In order to improve the loading speed of the page and simultaneously not affect the use of the search engine, the server can perform differentiated processing based on different access requests of the client. Therefore, on the basis of the above embodiment, optionally, as shown in fig. 3, the process of generating the access request includes:
s301, obtaining the access type of the client aiming at the target paging.
Each list page comprises a page strip, and each page strip comprises a page link of each page, so that the client can access the target page by clicking the page link in the current page. Certainly, the client may also access the target page through the browser address bar, that is, the user inputs the address information of the target page to be accessed into the browser address bar and triggers the access operation, so that the client accesses the target page through the address information in the browser address bar after detecting the access operation of the user on the target page through the browser address bar. Of course, the client can also access the target pages through hyperlinks searched by the crawler tool. The present embodiment does not specifically limit the access type of the client for the target page.
S302, when the access type is a first access mode, generating the asynchronous request information, and generating a first access request according to the asynchronous request information and the URL address of the target paging.
The first access mode is a mode of accessing through a paging link in the current paging. Because the common content of each list paging in the target website is not changed greatly, and only the list content is different, when the page is loaded on the list paging, Ajax asynchronous loading operation can be adopted, so that the page loading speed is improved. For this situation, when the client accesses the target page through the page link in the current page, it may be considered that the access operation is triggered by the user behavior, and therefore, in order to improve the page loading speed and improve the access experience of the user, the client may add the asynchronous request information to the access request. Specifically, after detecting an access operation triggered by a user, the client generates asynchronous request information, acquires a URL address of a target page, and generates a first access request according to the URL address of the target page and the asynchronous request information. For example, the asynchronous request information is represented by a parameter isAjax, which may be set to 1 to indicate that an Ajax asynchronous load operation needs to be performed on the target page.
And S303, when the access type is a second access mode, generating a second access request according to the URL address of the target paging.
Wherein the second access mode is a mode other than the first access mode. When the client does not access the target page through the page link in the current page, the client may consider that the access operation is triggered by the search engine, and therefore, in order not to affect the search engine to capture page data, the client may directly generate a second access request based on the URL address of the target page.
Optionally, the second access mode includes a mode of accessing through a browser address bar and/or a mode of accessing through a crawler tool. For the mode of accessing the target page through the browser address bar, when a page of one page in the target website is accessed for the first time, because the client does not have the public content of each page locally, the client also directly generates a second access request based on the URL address of the page, and sends the second access request to the server. And the server receives the second access request, integrally renders the list content and the non-list content of the paging page, and returns an integral rendering result to the client.
In this embodiment, the client may generate a corresponding access request based on an access type of the target page, and when the access type is the first access manner, the client may generate the first access request based on the asynchronous request information and the URL address of the target page, and when the access type is the second access manner, the client may directly generate the second access request based on the URL address of the target page. Therefore, when the server receives a first access request sent by the client, the server can return html codes corresponding to the list content of the target page to the client, so that the client performs Ajax asynchronous loading operation on the target page, and the loading speed of the page is improved; when the server receives a second access request sent by the client, the server can send html codes corresponding to the whole content of the target page to the client, so that the search engine can conveniently capture page data of the target page, and ranking data of a website in the search engine is not influenced.
Next, taking the execution subject as the client as an example, specifically:
fig. 4 is another schematic flow chart of a page loading method according to an embodiment of the present application. The embodiment relates to a specific process of how the client side realizes page loading. As shown in fig. 4, the method may include:
s401, sending an access request aiming at the target paging to a server.
For list paging, when a client requests to open a list paging, an access request is sent to a server. For example, the client may send an access request to the server in HTTP, the access request including the address of the target page.
In practical applications, in order to increase the loading speed of the page without affecting the use of the search engine, the client may send different access requests to the server. In a scenario that an Ajax asynchronous loading operation needs to be performed on a target page (for example, in a scenario that an access operation of a client on the target page is triggered by a user), the client may carry asynchronous request information in an access request and send the access request information to a server. Under the scene that the Ajax asynchronous loading operation is not needed to be carried out on the target paging (for example, under the scene that the access operation of the client to the target paging is triggered by a search engine), the client does not carry asynchronous request information in the access request, and the access request is directly generated according to the URL address of the target paging.
As an optional implementation manner, when the client accesses the target page through the page link in the current page, it may be considered that the access operation is triggered by the user behavior, and therefore, in order to increase the page loading speed and improve the access experience of the user, the client may add asynchronous request information to the access request sent to the server. Specifically, after detecting an access operation triggered by a user, a client generates asynchronous request information, acquires a URL address of a target page, generates a first access request according to the URL address of the target page and the asynchronous request information, and sends the first access request to a server.
For the above situation, optionally, the generating process of the access request may include: obtaining the access type of the client aiming at the target paging; when the access type is a first access mode, generating the asynchronous request information, and generating a first access request according to the asynchronous request information and the URL address of the target paging; when the access type is a second access mode, generating a second access request according to the URL address of the target paging; the first access mode is a mode of accessing through a paging link in a current paging, and the second access mode is other modes except the first access mode.
In a specific implementation, in order to know that the client is the access of the target page triggered by the first access mode, optionally, a click event may be pre-bound in a page code link tag of the page bar, that is, a click event is pre-bound in a page code link tag of the page bar. In this way, when the client monitors that the click event of the target page binding is triggered, the client can determine that the access type of the target page is the first access mode. At this time, the client may generate asynchronous request information, generate a first access request according to the asynchronous request information and the URL address of the target page, and send the first access request to the server to request asynchronous loading of the target page. Meanwhile, in order to enable the server to asynchronously load the target page, when it is monitored that a click event of the target page binding is triggered, the client needs to intercept an operation of generating a second access request by the browser, where the second access request is generated based on a URL address of the target page.
When the client does not access the target page through the page link in the current page, the access operation can be considered to be triggered by the search engine, so that the client can directly generate a second access request based on the URL address of the target page and send the second access request to the server in order to not influence the search engine to fetch page data.
S402, when the access request comprises asynchronous request information, receiving html codes corresponding to the list content of the target paging sent by the server, and updating the list content of the current paging according to the html codes corresponding to the list content.
The asynchronous request information is used for indicating that the target paging needs to be subjected to asynchronous loading operation. After the server receives the access request sent by the client, the server determines whether the access request comprises asynchronous request information. And when the server determines that the access request comprises asynchronous request information, the server returns html codes corresponding to the list contents of the target paging to the client. Therefore, after the client receives the html code corresponding to the list content of the target paging sent by the server, the client updates the list content of the current paging according to the html code, and therefore asynchronous loading of the target paging is achieved.
Optionally, because the client uses the asynchronous Ajax loading technology, the whole page is not refreshed again, and the address information in the address bar of the browser is not changed. In order to facilitate direct access to other paging pages through the browser address bar, optionally, while the client updates the list content of the current paging according to the html code corresponding to the returned list content, the client also modifies the current address in the browser address bar into the URL address of the target paging.
Optionally, because the client uses the asynchronous Ajax loading technology, the browser does not store the asynchronously loaded page. In order to turn pages through the forward control and the backward control of the browser, optionally, the client updates the list content of the current page according to the html code corresponding to the returned list content, and simultaneously, the client adds the URL address of the current page to the history record of the browser.
S403, when the access request does not include asynchronous request information, receiving html codes corresponding to the whole content of the target paging sent by the server, and loading the whole content of the target paging according to the html codes corresponding to the whole content.
When the server determines that the access request does not include asynchronous request information, the server returns html codes corresponding to the whole content of the target page to the client. In this way, after the client receives the html code corresponding to the entire content of the target page sent by the server, the client directly loads the entire page content of the target page, including the list content and the non-list content, according to the html code. Therefore, the search engine can conveniently capture the page data of the target pages, and ranking of the websites in the search engine is facilitated.
According to the page loading method provided by the embodiment of the application, a client sends an access request aiming at a target paging to a server, when the access request comprises asynchronous request information, html codes corresponding to the list content of the target paging sent by the server are received, the list content of the current paging is updated according to the html codes, when the access request does not comprise the asynchronous request information, html codes corresponding to the whole content of the target paging sent by the server are received, and the whole content of the target paging is loaded according to the html codes. When the Ajax asynchronous loading operation needs to be carried out on the target paging, the client sends an access request carrying asynchronous loading information to the server, so that the server only sends html codes corresponding to the list content of the target paging to the client, repeated rendering of the public content of the list paging by the server is avoided, the response performance of the server is improved, and the page loading speed is further improved. When Ajax asynchronous loading operation is not required to be carried out on the target page, for example, a search engine crawler pays attention to complete html codes and content information, the client sends an access request which does not contain asynchronous request information to the server, and therefore the server can return html codes corresponding to the whole content of the target page to the client, and the search engine can conveniently extract information content from the html codes. The technical scheme provided by the embodiment of the application not only improves the page loading speed, but also does not influence the use of the search engine, and ensures that ranking data of the website in the search engine is not influenced.
In order to facilitate understanding of the technical staff, the following describes a technical solution provided by an embodiment of the present application by taking an interaction between a client and a server as an example, and as shown in fig. 5, the method may include:
s501, the client acquires the access type aiming at the target paging.
And click events are bound in the paging code link labels of the paging bars in advance. When the client monitors that a click event of the target paging binding is triggered, determining that the access type of the target paging is a first access mode.
S502, when the access type is the first access mode, the client generates asynchronous request information, generates a first access request according to the asynchronous request information and the URL address of the target paging, and sends the first access request to the server.
The first access mode is a mode of accessing through a paging link in the current paging, and the asynchronous request information is used for indicating that Ajax asynchronous loading operation needs to be performed on the target paging. Optionally, the client further intercepts an operation of generating a second access request, where the second access request is generated based on the URL address of the target page.
And S503, when the access type is the second access mode, the client generates a second access request according to the URL address of the target paging, and sends the second access request to the server.
Wherein the second access mode is a mode other than the first access mode. Optionally, the second access mode includes a mode of accessing through a browser address bar and/or a mode of accessing through a crawler tool.
S504, when the access request comprises asynchronous request information, namely after the server receives the first access request, the server sends html codes corresponding to the list content of the target paging to the client.
And S505, when the asynchronous request information is determined not to be included in the access request, namely after the server receives a second access request, the server sends html codes corresponding to the whole content of the target page to the client.
S506, when the client receives the html code corresponding to the target paging list content sent by the server, the client updates the current paging list content according to the html code.
Optionally, the client synchronously modifies the current address in the browser address bar into the URL address of the target page, and adds the URL address of the current page to the history of the browser.
And S507, when the client receives the html code corresponding to the whole content of the target paging sent by the server, the client loads the whole content of the target paging according to the html code.
Fig. 6 is a schematic structural diagram of a page loading apparatus according to an embodiment of the present application. As shown in fig. 6, the apparatus may include: an obtaining module 601, a first sending module 602, and a second sending module 603.
Specifically, the obtaining module 601 is configured to obtain an access request of a client for a target page;
the first sending module 602 is configured to send, to the client, an html code corresponding to the list content of the target page when it is determined that the access request includes asynchronous request information; the asynchronous request information is used for indicating that the target paging needs to be subjected to asynchronous loading operation;
the second sending module 603 is configured to send, to the client, html code corresponding to the entire content of the target page when it is determined that the access request does not include asynchronous request information.
According to the page loading device provided by the embodiment of the application, after the access request of the client for the target page is obtained, when the access request is determined to include asynchronous request information, the html code corresponding to the list content of the target page is sent to the client; and when the asynchronous request information is determined not to be included in the access request, sending html code corresponding to the whole content of the target page to the client. When the Ajax asynchronous loading operation needs to be carried out on the target paging, the server only sends html codes corresponding to the list content of the target paging to the client, and repeated rendering of the public content of the list paging by the server is avoided, so that the response performance of the server is improved, and the page loading speed is further improved. When Ajax asynchronous loading operation is not required to be performed on the target page, for example, the search engine crawler pays attention to complete html codes and content information, for the situation, the access request does not contain asynchronous request information, and the server can return html codes corresponding to the whole content of the target page to the client, so that the search engine can conveniently extract information content from the html codes. The page loading device provided by the embodiment of the application not only improves the page loading speed, but also does not influence the use of a search engine, and ensures that ranking data of a website in the search engine is not influenced.
On the basis of the above embodiment, optionally, the apparatus further includes: splitting the module;
specifically, the splitting module is configured to split the target page into list content and non-list content before the obtaining module 601 obtains an access request of the client for the target page.
Fig. 7 is another schematic structural diagram of a page loading apparatus according to an embodiment of the present application. As shown in fig. 7, the apparatus may include: a sending module 701, a first receiving module 702, a first processing module 703, a second receiving module 704 and a second processing module 705;
specifically, the sending module 701 is configured to send an access request for a target page to a server;
the first receiving module 702 is configured to receive an html code corresponding to the list content of the target page sent by the server when the access request includes asynchronous request information; the asynchronous request information is used for indicating that the target paging needs to be subjected to asynchronous loading operation;
the first processing module 703 is configured to update the list content of the current page according to the html code corresponding to the list content;
the second receiving module 704 is configured to receive html code corresponding to the entire content of the target page sent by the server when the access request does not include asynchronous request information;
the second processing module 705 is configured to load the entire content of the target page according to the html code corresponding to the entire content.
According to the page loading device provided by the embodiment of the application, a client sends an access request aiming at a target page to a server, when the access request comprises asynchronous request information, html codes corresponding to the list content of the target page sent by the server are received, the list content of the current page is updated according to the html codes, when the access request does not comprise the asynchronous request information, html codes corresponding to the whole content of the target page sent by the server are received, and the target page is loaded according to the html codes. When the Ajax asynchronous loading operation needs to be carried out on the target paging, the client sends an access request carrying asynchronous loading information, so that the server only sends html codes corresponding to the list content of the target paging to the client, repeated rendering of the public content of the list paging by the server is avoided, the response performance of the server is improved, and the page loading speed is further improved. When Ajax asynchronous loading operation is not required to be carried out on the target page, for example, a search engine crawler pays attention to complete html codes and content information, the client sends an access request which does not contain asynchronous request information to the server, and therefore the server can return html codes corresponding to the whole content of the target page to the client, and the search engine can conveniently extract information content from the html codes. The technical scheme provided by the embodiment of the application not only improves the page loading speed, but also does not influence the use of the search engine, ensures that the ranking data of the website in the search engine is not influenced, and ensures that the ranking data of the website in the search engine is not influenced.
On the basis of the above embodiment, optionally, the apparatus further includes: the device comprises an acquisition module, a first generation module and a second generation module;
specifically, the obtaining module is configured to obtain an access type of the client for the target page;
the first generation module is used for generating the asynchronous request information when the access type is a first access mode, and generating a first access request according to the asynchronous request information and the URL address of the target paging; the first access mode is a mode of accessing through a paging link in the current paging;
the second generation module is used for generating a second access request according to the URL address of the target paging when the access type is a second access mode; wherein the second access mode is a mode other than the first access mode.
Optionally, click events are bound in the paging code link labels of the paging bars in advance;
the obtaining module is specifically configured to determine that the access type to the target page is a first access mode when it is monitored that a click event of the target page binding is triggered.
On the basis of the above embodiment, optionally, the apparatus further includes: an interception module;
the intercepting module is used for intercepting the operation of generating a second access request when the click event of the target paging binding is monitored to be triggered, wherein the second access request is generated based on the URL address of the target paging.
Optionally, the second access mode includes a mode of accessing through a browser address bar and/or a mode of accessing through a crawler tool.
On the basis of the above embodiment, optionally, the apparatus further includes: a third processing module;
specifically, the third processing module is configured to modify the current address in the address bar of the browser to the URL address of the target page synchronously when the first processing module 703 updates the list content of the current page according to the html code corresponding to the list content.
On the basis of the above embodiment, optionally, the apparatus further includes: a fourth processing module;
specifically, the fourth processing module is configured to add the URL address of the current page to a history of the browser.
In one embodiment, a page loading device (the page loading device may be a server or a client) is provided, and a schematic structural diagram of the page loading device may be as shown in fig. 8. The page loading device comprises a processor and a memory which are connected through a system bus. Wherein the processor of the page loading device is configured to provide computing and control capabilities. The memory of the page loading device is used for storing a computer program. The computer program is executed by a processor to implement a page loading method.
Those skilled in the art will appreciate that the structure shown in fig. 8 is a block diagram of only a portion of the structure associated with the present application and does not constitute a limitation on the page loading apparatus to which the present application is applied, and that a particular page loading apparatus may include more or less components than those shown in the figure, or combine certain components, or have a different arrangement of components.
In one embodiment, there is provided a server comprising a memory and a processor, the memory having a computer program stored therein, the processor when executing the computer program implementing the steps of:
acquiring an access request of a client for a target page;
when the access request is determined to include asynchronous request information, sending an html code corresponding to the list content of the target paging to the client; the asynchronous request information is used for expressing that Ajax asynchronous loading operation needs to be carried out on the target paging;
and when the access request does not comprise asynchronous request information, sending html codes corresponding to the whole content of the target paging to the client.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and splitting the target paging into list content and non-list content.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring an access request of a client for a target page;
when the access request is determined to include asynchronous request information, sending an html code corresponding to the list content of the target paging to the client; the asynchronous request information is used for expressing that Ajax asynchronous loading operation needs to be carried out on the target paging;
and when the access request does not comprise asynchronous request information, sending html codes corresponding to the whole content of the target paging to the client.
In one embodiment, the computer program when executed by the processor further performs the steps of: and splitting the target paging into list content and non-list content.
In one embodiment, there is provided a client comprising a memory and a processor, the memory having a computer program stored therein, the processor when executing the computer program implementing the steps of:
sending an access request aiming at the target paging to a server;
when the access request comprises asynchronous request information, receiving html codes corresponding to the target paging list content sent by the server, and updating the current paging list content according to the html codes corresponding to the list content; the asynchronous request information is used for indicating that the target paging needs to be subjected to asynchronous loading operation;
and when the access request does not include asynchronous request information, receiving html codes corresponding to the whole content of the target paging sent by the server, and loading the whole content of the target paging according to the html codes corresponding to the whole content.
In one embodiment, the processor, when executing the computer program, further performs the steps of: obtaining the access type of the client aiming at the target paging; when the access type is a first access mode, generating the asynchronous request information, and generating a first access request according to the asynchronous request information and the URL address of the target paging; the first access mode is a mode of accessing through a paging link in the current paging; when the access type is a second access mode, generating a second access request according to the URL address of the target paging; wherein the second access mode is a mode other than the first access mode.
In one embodiment, the click event is pre-bound in the paging code link tag of the page bar, and the processor when executing the computer program further implements the following steps: when it is monitored that a click event of target page binding is triggered, determining that the access type of the target page is a first access mode.
In one embodiment, the processor, when executing the computer program, further performs the steps of: intercepting an operation that generates a second access request, wherein the second access request is generated based on the URL address of the target page.
Optionally, the second access mode includes a mode of accessing through a browser address bar and/or a mode of accessing through a crawler tool.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and when the list content of the current paging is updated according to the html code corresponding to the list content, synchronously modifying the current address in the address bar of the browser into the URL address of the target paging.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and adding the URL address of the current page into the history of the browser.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
sending an access request aiming at the target paging to a server;
when the access request comprises asynchronous request information, receiving html codes corresponding to the target paging list content sent by the server, and updating the current paging list content according to the html codes corresponding to the list content; the asynchronous request information is used for indicating that the target paging needs to be subjected to asynchronous loading operation;
and when the access request does not include asynchronous request information, receiving html codes corresponding to the whole content of the target paging sent by the server, and loading the whole content of the target paging according to the html codes corresponding to the whole content.
In one embodiment, the computer program when executed by the processor further performs the steps of: obtaining the access type of the client aiming at the target paging; when the access type is a first access mode, generating the asynchronous request information, and generating a first access request according to the asynchronous request information and the URL address of the target paging; the first access mode is a mode of accessing through a paging link in the current paging; when the access type is a second access mode, generating a second access request according to the URL address of the target paging; wherein the second access mode is a mode other than the first access mode.
In one embodiment, the click event is pre-bound in a paging code link tag of the page bar, and the computer program when executed by the processor further performs the steps of: when it is monitored that a click event of target page binding is triggered, determining that the access type of the target page is a first access mode.
In one embodiment, the computer program when executed by the processor further performs the steps of: intercepting an operation that generates a second access request, wherein the second access request is generated based on the URL address of the target page.
Optionally, the second access mode includes a mode of accessing through a browser address bar and/or a mode of accessing through a crawler tool.
In one embodiment, the computer program when executed by the processor further performs the steps of: and when the list content of the current paging is updated according to the html code corresponding to the list content, synchronously modifying the current address in the address bar of the browser into the URL address of the target paging.
In one embodiment, the computer program when executed by the processor further performs the steps of: and adding the URL address of the current page into the history of the browser.
The page loading device, the page loading device and the storage medium provided in the above embodiments may execute the page loading method provided in any embodiment of the present application, and have corresponding functional modules and beneficial effects for executing the method. For technical details that are not described in detail in the above embodiments, reference may be made to a page loading method provided in any embodiment of the present application.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (13)

1. A page loading method is characterized by comprising the following steps:
acquiring an access request of a client for a target page;
when the access request is determined to include asynchronous request information, sending an html code corresponding to the list content of the target paging to the client; the asynchronous request information is used for expressing that Ajax asynchronous loading operation needs to be carried out on the target paging;
and when the access request does not comprise asynchronous request information, sending html codes corresponding to the whole content of the target paging to the client.
2. The method of claim 1, wherein prior to obtaining the client's access request for the target page, the method further comprises:
and splitting the target paging into list content and non-list content.
3. A page loading method is characterized by comprising the following steps:
sending an access request aiming at the target paging to a server;
when the access request comprises asynchronous request information, receiving html codes corresponding to the target paging list content sent by the server, and updating the current paging list content according to the html codes corresponding to the list content; the asynchronous request information is used for indicating that the target paging needs to be subjected to asynchronous loading operation;
and when the access request does not include asynchronous request information, receiving html codes corresponding to the whole content of the target paging sent by the server, and loading the whole content of the target paging according to the html codes corresponding to the whole content.
4. The method of claim 3, wherein the generating of the access request comprises:
obtaining the access type of the client aiming at the target paging;
when the access type is a first access mode, generating the asynchronous request information, and generating a first access request according to the asynchronous request information and the Uniform Resource Locator (URL) address of the target paging; the first access mode is a mode of accessing through a paging link in the current paging;
when the access type is a second access mode, generating a second access request according to the URL address of the target paging; wherein the second access mode is a mode other than the first access mode.
5. The method of claim 4, wherein click events are pre-bound in paging code link tags of a pagebar;
the obtaining of the access type of the client for the target page includes:
when it is monitored that a click event of target page binding is triggered, determining that the access type of the target page is a first access mode.
6. The method of claim 5, further comprising:
intercepting an operation that generates a second access request, wherein the second access request is generated based on the URL address of the target page.
7. The method of claim 4, wherein the second access mode comprises a mode of access through a browser address bar and/or a mode of access through a crawler tool.
8. The method of claim 3, further comprising:
and when the list content of the current paging is updated according to the html code corresponding to the list content, synchronously modifying the current address in the address bar of the browser into the URL address of the target paging.
9. The method of claim 3, further comprising:
and adding the URL address of the current page into the history of the browser.
10. A page loading apparatus, comprising:
the acquisition module is used for acquiring an access request of a client aiming at a target page;
the first sending module is used for sending the html code corresponding to the list content of the target paging to the client when the access request is determined to include asynchronous request information; the asynchronous request information is used for indicating that the target paging needs to be subjected to asynchronous loading operation;
and a second sending module, configured to send, to the client, an html code corresponding to the entire content of the target page when it is determined that the access request does not include asynchronous request information.
11. A page loading apparatus, comprising:
the sending module is used for sending an access request aiming at the target paging to the server;
a first receiving module, configured to receive, when the access request includes asynchronous request information, an html code corresponding to list content of the target page sent by the server; the asynchronous request information is used for indicating that the target paging needs to be subjected to asynchronous loading operation;
the first processing module is used for updating the current paged list content according to the html code corresponding to the list content;
a second receiving module, configured to receive, when the access request does not include asynchronous request information, an html code corresponding to the entire content of the target page sent by the server;
and the second processing module is used for loading the whole content of the target paging according to the html code corresponding to the whole content.
12. A page loading device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any one of claims 1 to 9.
13. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 9.
CN202011457388.XA 2020-12-10 2020-12-10 Page loading method, device, equipment and storage medium Pending CN112433784A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011457388.XA CN112433784A (en) 2020-12-10 2020-12-10 Page loading method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011457388.XA CN112433784A (en) 2020-12-10 2020-12-10 Page loading method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112433784A true CN112433784A (en) 2021-03-02

Family

ID=74692524

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011457388.XA Pending CN112433784A (en) 2020-12-10 2020-12-10 Page loading method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112433784A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113343143A (en) * 2021-05-24 2021-09-03 上海万物新生环保科技集团有限公司 Method and equipment for streaming loading webpage template
CN114611039A (en) * 2022-02-25 2022-06-10 盐城金堤科技有限公司 Asynchronous loading rule analysis method and device, storage medium and electronic equipment

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090210631A1 (en) * 2006-09-22 2009-08-20 Bea Systems, Inc. Mobile application cache system
CN102968322A (en) * 2012-11-22 2013-03-13 用友软件股份有限公司 Data loading device and data loading method
CN103164446A (en) * 2011-12-14 2013-06-19 阿里巴巴集团控股有限公司 Webpage request information response method and webpage request information response device
US20140298308A1 (en) * 2013-03-28 2014-10-02 Naver Business Platform Corp. System, method and computer-readable recording medium for synchronous script lazy loading
CN104462455A (en) * 2014-12-16 2015-03-25 北京京东尚科信息技术有限公司 Method and device for displaying and processing network data
CN105302846A (en) * 2014-08-01 2016-02-03 腾讯科技(北京)有限公司 Method and device for restoring webpage
CN109582890A (en) * 2018-10-25 2019-04-05 平安科技(深圳)有限公司 Page loading method, device, computer equipment and storage medium
CN111274510A (en) * 2020-01-15 2020-06-12 平安银行股份有限公司 Page rendering method, device and equipment and readable storage medium
CN111639289A (en) * 2020-05-13 2020-09-08 北京三快在线科技有限公司 Webpage loading method and device
CN111782213A (en) * 2020-06-30 2020-10-16 贵州北斗领航科技有限责任公司 Dynamic control page generation system based on DOM
CN112051994A (en) * 2019-06-06 2020-12-08 阿里巴巴集团控股有限公司 Visual component information processing and page visual design method and device

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090210631A1 (en) * 2006-09-22 2009-08-20 Bea Systems, Inc. Mobile application cache system
CN103164446A (en) * 2011-12-14 2013-06-19 阿里巴巴集团控股有限公司 Webpage request information response method and webpage request information response device
CN102968322A (en) * 2012-11-22 2013-03-13 用友软件股份有限公司 Data loading device and data loading method
US20140298308A1 (en) * 2013-03-28 2014-10-02 Naver Business Platform Corp. System, method and computer-readable recording medium for synchronous script lazy loading
CN105302846A (en) * 2014-08-01 2016-02-03 腾讯科技(北京)有限公司 Method and device for restoring webpage
CN104462455A (en) * 2014-12-16 2015-03-25 北京京东尚科信息技术有限公司 Method and device for displaying and processing network data
CN109582890A (en) * 2018-10-25 2019-04-05 平安科技(深圳)有限公司 Page loading method, device, computer equipment and storage medium
CN112051994A (en) * 2019-06-06 2020-12-08 阿里巴巴集团控股有限公司 Visual component information processing and page visual design method and device
CN111274510A (en) * 2020-01-15 2020-06-12 平安银行股份有限公司 Page rendering method, device and equipment and readable storage medium
CN111639289A (en) * 2020-05-13 2020-09-08 北京三快在线科技有限公司 Webpage loading method and device
CN111782213A (en) * 2020-06-30 2020-10-16 贵州北斗领航科技有限责任公司 Dynamic control page generation system based on DOM

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113343143A (en) * 2021-05-24 2021-09-03 上海万物新生环保科技集团有限公司 Method and equipment for streaming loading webpage template
CN114611039A (en) * 2022-02-25 2022-06-10 盐城金堤科技有限公司 Asynchronous loading rule analysis method and device, storage medium and electronic equipment
CN114611039B (en) * 2022-02-25 2024-02-20 盐城天眼察微科技有限公司 Analysis method and device of asynchronous loading rule, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
CN110263275B (en) Method and device for accessing webpage, mobile terminal and storage medium
CN106294648B (en) Processing method and device for page access path
US8527862B2 (en) Methods for making ajax web applications bookmarkable and crawlable and devices thereof
CN106990975B (en) Application heat deployment method, device and system
CN108717435B (en) Webpage loading method, information processing method, computer equipment and storage medium
CN110647699A (en) Web page rendering method and device, computer equipment and storage medium
US10440140B2 (en) Browser cache management
CN110647700A (en) Page resource loading method and device, computer equipment and storage medium
WO2015062416A1 (en) Method and device for loading webpages based onuiwebview components
US8516041B1 (en) Pre-fetching asynchronously requested content
CN110221871B (en) Webpage acquisition method and device, computer equipment and storage medium
WO2020207022A1 (en) Scrapy-based data crawling method and system, terminal device, and storage medium
CN112637361B (en) Page proxy method, device, electronic equipment and storage medium
CN112433784A (en) Page loading method, device, equipment and storage medium
CN111191158A (en) Webpage resource caching method and device, computer equipment and storage medium
CN111431767B (en) Multi-browser resource synchronization method and device, computer equipment and storage medium
US20120260327A1 (en) Multi-browser authentication
CN111339456A (en) Preloading method and device
CN113330432A (en) Asynchronous predictive caching of content listed in search results
CN113688022A (en) Browser performance monitoring method, device, equipment and medium
CN111984868A (en) Method and device for controlling webpage browsing in browser
CN110460685B (en) User unique identifier processing method and device, computer equipment and storage medium
CN113778544A (en) Resource loading optimization method, device and system, electronic equipment and storage medium
CN113297515A (en) Resource information processing method and device, computer storage medium and electronic equipment
CN110830537A (en) Page processing method and device

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