CN103412898A - Method and device for optimizing webpage - Google Patents

Method and device for optimizing webpage Download PDF

Info

Publication number
CN103412898A
CN103412898A CN2013103198344A CN201310319834A CN103412898A CN 103412898 A CN103412898 A CN 103412898A CN 2013103198344 A CN2013103198344 A CN 2013103198344A CN 201310319834 A CN201310319834 A CN 201310319834A CN 103412898 A CN103412898 A CN 103412898A
Authority
CN
China
Prior art keywords
web
info web
information
info
page requests
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.)
Granted
Application number
CN2013103198344A
Other languages
Chinese (zh)
Other versions
CN103412898B (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201310319834.4A priority Critical patent/CN103412898B/en
Publication of CN103412898A publication Critical patent/CN103412898A/en
Application granted granted Critical
Publication of CN103412898B publication Critical patent/CN103412898B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention is applicable to the technical field of the Internet, and provides a method and a device for optimizing a webpage. The method comprises the steps as follows: webpage request information sent by the a client is received; when information corresponding to the webpage request information doesn't exist in high-speed cache, the webpage request information is sent to a web server; the webpage information returned by the webserver and corresponding to the webpage request information is received; the webpage information is subjected to asynchronous treatment, and the asynchronous treatment comprises that a cache strategy of the webpage information is modified into a non-cache strategy, and the webpage information of the modified cache strategy is sent to the client; and the cache strategy of the webpage information is judged, and corresponding cache treatment is performed according to a judgment result. According to the method and the device for optimizing the webpage, delay time of webpage display can be effectively reduced.

Description

Method and device that a kind of webpage is optimized
Technical field
The invention belongs to Internet technical field, relate in particular to method and device that a kind of webpage is optimized.
Background technology
Along with the development of internet, and the intelligent degree such as PC, mobile terminal (as mobile phone, panel computer) are more and more higher, and increasing user uses these terminal access webpages.Yet, because existing webpage is all generally for the high stable bandwidth, the PC design of high operational performance, mobile terminal is due to the restriction (such as limited mobile network's bandwidth, limited computational resource etc.) of himself hardware, cause mobile phone users when browsing page, the problems such as the webpage loading velocity is slow, web displaying delay easily occur, therefore need to be optimized described webpage.
Prior art provides a kind of webpage optimization method, detailed process as shown in Figure 1:
Step 101, client send web-page requests information to the pagespeed container;
Step 102, pagespeed container forward described web-page requests information to web server;
Step 103, web server are returned to corresponding info web to the pagespeed container;
Step 104, pagespeed container are transferred to the pagespeed module by described info web piecemeal and process after receiving the info web that web server returns;
Step 105, pagespeed module pass the info web of coming to the pagespeed container and carry out pre-service, and described pre-service comprises decompression, parsing, rewriting etc.;
Step 106, pagespeed module are passed to the pagespeed container by pretreated info web, and the pagespeed container is revised as non-buffer memory by the cache policy of described info web;
Step 107, pagespeed container send to client by the amended info web of cache policy.
Prior art is integrated and is rewritten info web by pagespeed container and pagespeed module, can reduce mutual between web server and client, improves web displaying speed.Yet prior art need to be revised as the cache policy of original web page non-buffering no-cache strategy after webpage is optimized, webpage becomes the mutual frequency that the no-cache strategy has increased acting server and web server afterwards greatly.
Summary of the invention
A kind of method that the embodiment of the present invention provides webpage to optimize, be modified to solve its cache policy of original web page, increases the problem of acting server and the mutual frequency of web server.
First aspect, a kind of method that webpage is optimized, described method comprises:
Receive the web-page requests information that client sends;
When in high-speed cache, not existing with the corresponding information of described web-page requests information, send described web-page requests information to web server;
Receive the info web corresponding with described web-page requests information that web server is returned;
Described info web is carried out to asynchronous process, and described asynchronous process comprises:
The cache policy of described info web is revised as to non-buffer memory, and the amended info web of cache policy is sent to described client; And
Judge the cache policy of described info web, carry out corresponding caching process according to judged result.
In the first of first aspect may implementation, describedly according to judged result, carry out corresponding caching process and comprise:
When the cache policy of described info web was non-buffer memory, the described info web of mark was non-buffer memory, and described mark is saved to described high-speed cache; When but the cache policy of described info web is buffer memory, described info web is carried out to pre-service, and pretreated info web is saved to described high-speed cache.
In conjunction with the first possibility implementation of first aspect or first aspect, in the second possibility implementation, described method also comprises:
In described high-speed cache, exist and the corresponding information of described web-page requests information, and corresponding information is that the described info web of mark is while being the information of non-buffer memory, to web server, send described web-page requests information, and receive the info web corresponding with described web-page requests information that web server is returned, this info web is carried out sending to described client after pre-service.
In conjunction with the first possibility implementation of first aspect or first aspect, in the third possibility implementation, described method also comprises:
In described high-speed cache, exist and the corresponding information of described web-page requests information, and corresponding information sends to described client by this info web while being the info web corresponding with described web-page requests information.
In conjunction with the third possibility implementation of first aspect, in the 4th kind of possibility implementation, before this info web was sent to described client, described method also comprised:
Whether out of date according to info web described in the query caching of Preset Time interval, if expired, the mode by asynchronous process sends described web-page requests information to obtain the up-to-date information of this info web to web server.
In conjunction with the first possibility implementation of first aspect or first aspect or the second possibility implementation or the third possibility implementation of first aspect or the 4th kind of possibility implementation of first aspect of first aspect, in the 5th kind of possibility implementation, described pre-service comprises:
The external linkage of being rewritten in described info web is reduced to original external linkage, and described original external linkage is the external linkage in this info web on web server.
Second aspect, the device that a kind of webpage is optimized, described device comprises:
First information receiving element, the web-page requests information sent be used to receiving client;
Information transmitting unit, when at high-speed cache, not having the corresponding information of web-page requests information received with described first information receiving element, send described web-page requests information to web server;
The second information receiving unit, the info web corresponding with described web-page requests information returned be used to receiving web server;
The first processing unit, for described info web is carried out to asynchronous process, described asynchronous process comprises: the cache policy of described info web is revised as to non-buffer memory, and the amended info web of cache policy is sent to described client; And the cache policy that judges described info web, according to judged result, carry out corresponding caching process.
In the first of second aspect may implementation, described the first processing unit specifically for:
When the cache policy of described info web was non-buffer memory, the described info web of mark was non-buffer memory, and described mark is saved to described high-speed cache; When but the cache policy of described info web is buffer memory, described info web is carried out to pre-service, and pretreated info web is saved to described high-speed cache.
In conjunction with the first possibility implementation of second aspect or second aspect, in the second possibility implementation, described device also comprises:
The second processing unit, for at described high-speed cache, there being the corresponding information of web-page requests information received with described first information receiving element, and corresponding information is that the described info web of mark is while being the information of non-buffer memory, to web server, send described web-page requests information, and receive the info web corresponding with described web-page requests information that web server is returned, this info web is carried out sending to described client after pre-service.
In conjunction with the first possibility implementation of second aspect or second aspect, in the third possibility implementation, described device also comprises:
The 3rd processing unit, for at described high-speed cache, there being the corresponding information of web-page requests information received with described first information receiving element, and when corresponding information is the info web corresponding with described web-page requests information, this info web is sent to described client.
In conjunction with the third possibility implementation of second aspect, in the 4th kind of possibility implementation, described device also comprises:
Fourth processing unit, for before described the 3rd processing unit sends to described client by this info web, described in the query caching of interval, whether info web is out of date at preset timed intervals, if expired, the mode by asynchronous process sends described web-page requests information to obtain the up-to-date information of this info web to web server.
In conjunction with the first possibility implementation of second aspect or second aspect or the second possibility implementation or the third possibility implementation of second aspect or the 4th kind of possibility implementation of second aspect of second aspect, in the 5th kind of possibility implementation, described pre-service comprises:
The external linkage of being rewritten in described info web is reduced to original external linkage, and described original external linkage is the external linkage in this info web on web server.
The beneficial effect that the embodiment of the present invention compared with prior art exists is: 1) by the cache stores info web, make the client can be directly from described high-speed cache, obtaining some required info web, and do not need all from web server, to obtain at every turn, thereby can effectively improve the speed that client terminal web page loads, reduce web displaying time delay.And due to can be directly from described high-speed cache, obtaining some required info web, thereby do not need all described info web to be carried out to pre-service at every turn, reduced the processing pressure of acting server.In addition, when carrying out buffer memory, do not revise the cache policy of info web, can effectively reduce the mutual frequency of acting server and web server; 2) adopt the asynchronous process mode to process described info web, the transmission that is about to info web is synchronizeed and is carried out with the buffer memory of info web, make client when obtaining info web first, can not affect the efficiency of obtaining first info web, reduce the time delay of web displaying.
The accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, below will the accompanying drawing of required use in embodiment or description of the Prior Art be briefly described, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the system architecture diagram that the webpage that provides of one embodiment of the invention is optimized;
Fig. 2 is the realization flow figure of the webpage optimization method that provides of one embodiment of the invention;
Fig. 3 is the realization flow figure of the webpage optimization method that provides of one embodiment of the invention;
Fig. 4 is the particular flow sheet of the webpage optimization method that provides of one embodiment of the invention;
Fig. 5 is the particular flow sheet of the webpage optimization method that provides of another embodiment of the present invention;
Fig. 6 is the composition structural drawing of the webpage optimization device that provides of one embodiment of the invention;
Fig. 7 is the composition structural drawing of the webpage optimization device that provides of another embodiment of the present invention.
Embodiment
In below describing, in order to illustrate rather than, in order limiting, to have proposed the detail such as particular system structure, interface, technology, understand the embodiment of the present invention in order to thoroughly cut.Yet, not it will be clear to one skilled in the art that in there is no other embodiment of these details and can realize the present invention yet.In other situation, omit the detailed description to well-known device, circuit and method, in order to avoid unnecessary details hinders description of the invention.
Term in the embodiment of the present invention " system " and " network " in this article often can be by Alternates.
The system architecture diagram that Fig. 1 optimizes for a kind of webpage that the embodiment of the present invention provides.Wherein, described system comprises client 1, acting server 2 and web server 3;
Described client 1, acting server 2 and web server 3 connect communication by wired or wireless mode.
Wherein, described client 1 can be the terminal device that has arbitrarily network access facility, includes but not limited to mobile phone, panel computer, desktop computer, notebook computer etc.
Described acting server 2 and web server 3 can be single servers, also can be the server end jointly be comprised of several function servers.
In the present embodiment, described acting server 2 also includes page acceleration pagespeed container 21, the page accelerates pagespeed module 22 and high-speed cache 23.
Pagespeed container 21 receives the web-page requests information that client 1 sends, and described web-page requests information is transmitted to pagespeed module 22.Pagespeed module 22 is after receiving described web-page requests information, to described high-speed cache 23, send search request information, to search in high-speed cache 23, whether exist and the corresponding information of described web-page requests information, and receive that described high-speed cache 23 returns do not find information the time, to pagespeed container 21 feedbacks, do not find information.
Pagespeed module 22 starts to carry out asynchronous process with pagespeed container 21.Pagespeed module 22 sends described web-page requests information to described web server 3 respectively with pagespeed container 21.It should be noted that, pagespeed container 21 can send described web-page requests information to described web server 3 after receiving described feedback information.
Pagespeed module 22 receives respectively with pagespeed container 21 info web that web server 3 is that return and described web-page requests information is corresponding.Pagespeed container 21, after receiving the info web that web server 3 is that return and described web-page requests information is corresponding, sends to described client 1 after the cache policy of described info web is revised as to non-buffer memory; Pagespeed module 22 is after receiving the info web that web server 3 is that return and described web-page requests information is corresponding, judge the cache policy of described info web, when the cache policy of described info web is non-buffer memory, the described info web of mark is non-buffer memory, and described mark is saved to described high-speed cache 23; When but the cache policy of described info web is buffer memory, described info web is carried out to pre-service, and pretreated info web is saved to described high-speed cache 23.Wherein, described pre-service includes but not limited to the processing such as decompression, parsing, rewriting.Wherein said rewriting is processed and is comprised and described info web is carried out to typesetting by the display parameter (such as screen resolution, screen display width, length etc.) of client 1 and remove annotation in described info web, unnecessary space and attribute etc.; And/or the external linkage of being rewritten in described info web is reduced to original external linkage, described original external linkage is the external linkage in this info web on web server.
It should be noted that, find in actual applications, prior art is after optimizing webpage, and the external linkage in its info web may be rewritten, and can produce the problem that can't access while causing client 1 by this external linkage access web server.Therefore in order to address this problem, the present embodiment, when described info web is carried out to pre-service, need to be reduced to the external linkage of being rewritten in described info web original external linkage.
Further, the present embodiment also comprises:
In described high-speed cache 23, exist and the corresponding information of described web-page requests information, described high-speed cache 23 sends corresponding information to described pagespeed module 22.Described pagespeed module 22, after receiving corresponding information, sends to described pagespeed container 21 by corresponding information.Described pagespeed container 21 is after receiving corresponding information, corresponding information is detected, corresponding information being detected, be that the described info web of mark is while being the information of non-buffer memory, to web server 3, send described web-page requests information, and receive the info web that web server 3 is that return and described web-page requests information is corresponding, this info web is carried out sending to described client 1 after pre-service; When corresponding information being detected for the info web corresponding with described web-page requests information, directly this info web is sent to described client 1.
Further, for the info web to storage in high-speed cache 23 carries out real-time renewal, the present embodiment also comprises:
Whether described pagespeed module 22 info web described in interval query caching 23 at preset timed intervals is out of date, if expired, the mode by asynchronous process sends described web-page requests information to obtain the up-to-date information of this info web to web server 3.
It should be noted that, described pagespeed module 22 is after receiving the info web that web server 3 is that return and described web-page requests information is corresponding, still need to adopt the cache policy of the described info web of aforesaid way judgement, namely when the cache policy of described info web is non-buffer memory, the described info web of mark is non-buffer memory, and described mark is saved to described high-speed cache 23; When but the cache policy of described info web is buffer memory, described info web is carried out to pre-service, and pretreated info web is saved to described high-speed cache 23.
The system scene that the present embodiment provides, only be used to explaining the present invention, does not limit protection scope of the present invention.
Based on system architecture diagram shown in Figure 1, a kind of method that the embodiment of the present invention provides webpage to optimize, as shown in Figure 2, the flow performing main body of the present embodiment can be the acting server 2 in system shown in Figure 1, details are as follows for the method process:
In step S201, receive the web-page requests information that client sends.
In the present embodiment, acting server receives the web-page requests information that client sends.In wherein said web-page requests information, include the information such as URL(uniform resource locator), unique identifier.
In step S202, when in high-speed cache, not existing with the corresponding information of described web-page requests information, send described web-page requests information to web server.
In the present embodiment, the corresponding information of described web-page requests information includes but not limited to that the described info web of mark is the information of non-buffer memory or the info web corresponding with described web-page requests information etc.
Optionally, in order to improve the security of data transmission, if, while in described web-page requests information, including cookie information, delete this cookie information.
In step S203, receive the info web corresponding with described web-page requests information that web server is returned.
In step S204, described info web is carried out to asynchronous process, described asynchronous process comprises:
The cache policy of described info web is revised as to non-buffer memory, and the amended info web of cache policy is sent to described client; And
Judge the cache policy of described info web, carry out corresponding caching process according to judged result.
Based on system architecture diagram shown in Figure 1, a kind of method that the embodiment of the present invention provides webpage to optimize, as shown in Figure 3, the flow performing main body of the present embodiment can be the acting server 2 in system shown in Figure 1, details are as follows for the method process:
In step S301, receive the web-page requests information that client sends.
In the present embodiment, acting server receives the web-page requests information that client sends.In wherein said web-page requests information, include the information such as URL(uniform resource locator), unique identifier.
In step S302, judge in high-speed cache and whether exist and the corresponding information of described web-page requests information, if judgment result is that "Yes", perform step S303, otherwise execution step S304;
In the present embodiment, the corresponding information of described web-page requests information includes but not limited to that the described info web of mark is the information of non-buffer memory or the info web corresponding with described web-page requests information etc.
In step S303, detect corresponding information, and process accordingly according to testing result.
Concrete is, corresponding information being detected, be that the described info web of mark is while being the information of non-buffer memory, to web server, send described web-page requests information, and receive the info web corresponding with described web-page requests information that web server is returned, this info web is carried out sending to described client after pre-service; When corresponding information being detected for the info web corresponding with described web-page requests information, this info web is sent to described client.
The present embodiment is by the cache stores info web, when acting server receives the web-page requests information of client transmission, whether acting server first exists the info web corresponding with described web-page requests information from described high-speed cache, searching, can be directly from described high-speed cache, obtaining required info web if exist, and do not need all from web server, to obtain at every turn, thereby can effectively improve the speed that client terminal web page loads, reduce web displaying time delay.And due to can be directly from described high-speed cache, obtaining required info web, thereby do not need all described info web to be carried out to pre-service at every turn, reduced the processing pressure of acting server.In addition, when carrying out buffer memory, do not revise the cache policy of info web, can effectively reduce the mutual frequency of acting server and web server.
Further, for the info web to storing in high-speed cache carries out real-time renewal, the present embodiment, before the info web by high-speed cache sends to described client, also comprises:
Described in the query caching of interval, whether info web is out of date at preset timed intervals, if expired, the mode by asynchronous process sends described web-page requests information to obtain the up-to-date information of this info web to web server.
Exemplary, for convenient, upgrade, in described info web, can carry timestamp, the time of described timestamp for meaning that this info web is preserved.
When reaching described Preset Time interval, acting server is sent to web server by the timestamp of the info web preserved.Web server is after receiving described timestamp, according to described timestamp, judge whether the information that this info web is up-to-date, if have, new info web is sent to acting server to replace it the info web of front preservation, perhaps the more new portion of described info web is sent to the info web of acting server to preserve before upgrading, for example described info web has only upgraded a pictures, this pictorial information is sent to acting server, so that acting server upgrades the pictorial information in the info web of having preserved.
In step S304, send described web-page requests information to web server.
Optionally, in order to improve the security of data transmission, if, while in described web-page requests information, including cookie information, delete this cookie information.
In step S305, receive the info web corresponding with described web-page requests information that web server is returned;
In step S306, described info web is carried out to asynchronous process, described asynchronous process comprises:
The cache policy of described info web is revised as to non-buffer memory, and the amended info web of cache policy is sent to described client; And
Judge the cache policy of described info web, carry out corresponding caching process according to judged result.。
Wherein, according to judged result carry out corresponding caching process concrete can be:
When the cache policy of described info web was non-buffer memory, the described info web of mark was non-buffer memory, and described mark is saved to described high-speed cache; When but the cache policy of described info web is buffer memory, described info web is carried out to pre-service, and pretreated info web is saved to described high-speed cache.
Exemplary, if the cache-control information (cache policy) of described info web includes one or more in no-store, no-cache, max-age=0, determine that the cache policy of described info web is non-buffer memory.When definite described info web was non-buffer memory, without described info web is carried out to pre-service, directly the described info web of mark was non-buffer memory, and the mark of described info web is saved to described high-speed cache.In addition, cache policy for fear of long info web of holding time changes, the non-buffer memory mark of preserving does not conform to the cache policy of info web reality, the present embodiment also presets a time threshold value (for example 5 minutes), and the time that the non-buffer memory mark of described info web is preserved is less than or equal to described time threshold.
The purpose of the mark of the described info web of the present embodiment buffer memory is that client is while visiting again this info web next time, acting server directly obtains this info web from web server, and after pre-service, send to client, and do not need to carry out again the step of the cache policy of the described info web of judgement in above-mentioned S306.
In addition, described pre-service includes but not limited to the processing such as decompression, parsing, rewriting.Wherein said rewriting is processed and is comprised and described info web is carried out to typesetting by the display parameter (such as screen resolution, screen display width, length etc.) of client 1 and remove annotation in described info web, unnecessary space and attribute etc.; And/or the external linkage of being rewritten in described info web is reduced to original external linkage.
The present embodiment is by adopting described asynchronous process mode to process described info web, the transmission that is about to info web is synchronizeed and is carried out with the buffer memory of info web, make client when obtaining info web first, can not affect the efficiency of obtaining first info web, reduce the time delay of web displaying.
In addition, also it should be noted that, in the process of the present embodiment info web in upgrading high-speed cache, after receiving the info web corresponding with described web-page requests information that web server returns, also need to judge the cache policy of described info web, namely when the cache policy of described info web was non-buffer memory, the described info web of mark was non-buffer memory, and described mark is saved to described high-speed cache; When but the cache policy of described info web is buffer memory, described info web is carried out to pre-service, and pretreated info web is saved to described high-speed cache, for follow-up can be directly from high-speed cache, obtaining when receiving the same web-page requests information of client.
Fig. 4 shows the idiographic flow of the webpage optimization method that one embodiment of the invention provides, and the method can be applicable in system shown in Figure 1, and details are as follows for the method process:
In step S401, client sends web-page requests information to the pagespeed container;
In step S402, the pagespeed container is transmitted to the pagespeed module by described web-page requests information;
In step S403, whether the pagespeed module sends search request information to high-speed cache, exist and the corresponding information of described web-page requests information to search in high-speed cache;
In step S404, the pagespeed module receives the information that do not find that described high-speed cache returns, and 404 information of for example returning mean not find;
In step S405, the pagespeed module is to the described information that do not find of pagespeed container feedback;
In step S406, the pagespeed module sends described web-page requests information in the mode of asynchronous process to web server;
If, while in described web-page requests information, including cookie information, delete this cookie information.
In step S407, the pagespeed module receives the info web corresponding with described web-page requests information that web server is returned;
In step S408, the pagespeed module is processed described info web;
In step S409, the information after the pagespeed module will be processed is saved to described high-speed cache;
Concrete is, the pagespeed module is after receiving the info web corresponding with described web-page requests information that web server returns, judge the cache policy of described info web, when the cache policy of described info web is non-buffer memory, the described info web of mark is non-buffer memory, and described mark is saved to described high-speed cache; , when but the cache policy of described info web is buffer memory, described info web is carried out to pre-service (comprising the processing such as decompression, parsing, rewriting), and pretreated info web is saved to described high-speed cache.
Exemplary, if the cache-control information (cache policy) of described info web includes one or more in no-store, no-cache, max-age=0, determine that the cache policy of described info web is non-buffer memory.When definite described info web was non-buffer memory, without described info web is carried out to pre-service, directly the described info web of mark was non-buffer memory, and the mark of described info web is saved to described high-speed cache.In addition, cache policy for fear of long info web of holding time changes, the non-buffer memory mark of preserving does not conform to the cache policy of info web reality, the present embodiment also presets a time threshold value (for example 5 minutes), and the time that the non-buffer memory mark of described info web is preserved is less than or equal to described time threshold.
In step S410, the pagespeed container sends described web-page requests information to web server, can carry cookie information in described web-page requests information;
In step S411, the pagespeed container receives the info web corresponding with described web-page requests information that web server is returned;
In step S412, the pagespeed container is revised as non-buffer memory by the cache policy of described info web;
In step S413, the pagespeed container sends to client by the amended info web of cache policy.
Wherein, solid box shown in Fig. 4 is for meaning that step S406~S409 and step S410~S413 belong to the asynchronous process flow process.
Fig. 5 shows the idiographic flow of the webpage optimization method that another embodiment of the present invention provides, and the method can be applicable in system shown in Figure 1, and details are as follows for the method process:
In step S501, client sends web-page requests information to the pagespeed container;
In step S502, the pagespeed container is transmitted to the pagespeed module by described web-page requests information;
In step S503, whether the pagespeed module sends search request information to high-speed cache, exist and the corresponding information of described web-page requests information to search in high-speed cache;
In step S504, the pagespeed module receive that described high-speed cache returns with the corresponding information of described web-page requests information;
In step S505, the pagespeed module sends to described pagespeed container by corresponding information;
In step S506, the pagespeed container, after receiving corresponding information, detects corresponding information, processes accordingly according to testing result;
Concrete is, corresponding information being detected, be that the described info web of mark is while being the information of non-buffer memory, to web server, send described web-page requests information, and receive the info web corresponding with described web-page requests information that web server is returned, this info web is carried out sending to described client after pre-service; When corresponding information being detected for the info web corresponding with described web-page requests information, directly this info web sends to described client;
In step S507, the pagespeed container sends to client by result (being to carry out according to testing result the info web obtained after respective handling in step S506);
In step S508, whether pagespeed module info web described in the query caching of interval at preset timed intervals is out of date, if expired, performs step S509;
In step S509, the pagespeed module sends described web-page requests information in the mode of asynchronous process to web server;
If, while in described web-page requests information, including cookie information, delete this cookie information.
In step S510, the pagespeed module receives the info web corresponding with described web-page requests information that web server is returned;
In step S511, the pagespeed module is processed described info web;
In step S512, the information after the pagespeed module will be processed is saved to described high-speed cache;
Concrete is, the pagespeed module is after receiving the info web corresponding with described web-page requests information that web server returns, judge the cache policy of described info web, when the cache policy of described info web is non-buffer memory, the described info web of mark is non-buffer memory, and described mark is saved to described high-speed cache; , when but the cache policy of described info web is buffer memory, described info web is carried out to pre-service (comprising the processing such as decompression, parsing, rewriting), and pretreated info web is saved to described high-speed cache.
Exemplary, if the cache-control information (cache policy) of described info web includes one or more in no-store, no-cache, max-age=0, determine that the cache policy of described info web is non-buffer memory.When definite described info web was non-buffer memory, without described info web is carried out to pre-service, directly the described info web of mark was non-buffer memory, and the mark of described info web is saved to described high-speed cache.In addition, cache policy for fear of long info web of holding time changes, the non-buffer memory mark of preserving does not conform to the cache policy of info web reality, the present embodiment also presets a time threshold value (for example 5 minutes), and the time that the non-buffer memory mark of described info web is preserved is less than or equal to described time threshold.
Wherein, the solid box shown in Fig. 5 is for meaning that step S506~S507 and step S508~S512 belong to the asynchronous process flow process.
Fig. 6 shows the composition structure of the webpage optimization device that another embodiment of the present invention provides, and for convenience of explanation, only shows the part relevant to the embodiment of the present invention.
This webpage optimization device 6 can be applied in acting server shown in Figure 12.
This webpage segmenting device 6 specifically comprises first information receiving element 61, information transmitting unit 62, the second information receiving unit 63 and the first processing unit 64.Wherein, the concrete function of each unit is as follows:
First information receiving element 61, the web-page requests information sent be used to receiving client;
Information transmitting unit 62, when at high-speed cache, not having the corresponding information of web-page requests information received with described first information receiving element, send described web-page requests information to web server;
The second information receiving unit 63, the info web corresponding with described web-page requests information returned be used to receiving web server;
The first processing unit 64, for described info web is carried out to asynchronous process, described asynchronous process comprises: the cache policy of described info web is revised as to non-buffer memory, and the amended info web of cache policy is sent to described client; And the cache policy that judges described info web, according to judged result, carry out corresponding caching process.
Further, described the first processing unit 64 specifically for:
When the cache policy of described info web was non-buffer memory, the described info web of mark was non-buffer memory, and described mark is saved to described high-speed cache; When but the cache policy of described info web is buffer memory, described info web is carried out to pre-service, and pretreated info web is saved to described high-speed cache.
Further, described device 6 also comprises:
The second processing unit 65, for at described high-speed cache, there being the corresponding information of web-page requests information received with described first information receiving element, and corresponding information is that the described info web of mark is while being the information of non-buffer memory, to web server, send described web-page requests information, and receive the info web corresponding with described web-page requests information that web server is returned, this info web is carried out sending to described client after pre-service.
Further, described device 6 also comprises:
The 3rd processing unit 66, for at described high-speed cache, there being the corresponding information of web-page requests information received with described first information receiving element, and when corresponding information is the info web corresponding with described web-page requests information, this info web is sent to described client.
Further, described device 6 also comprises:
Fourth processing unit 67, for before described the 3rd processing unit 66 sends to described client by this info web, described in the query caching of interval, whether info web is out of date at preset timed intervals, if expired, the mode by asynchronous process sends described web-page requests information to obtain the up-to-date information of this info web to web server.
In the present embodiment, described pre-service includes but not limited to the processing such as decompression, parsing, rewriting.Wherein said rewriting is processed and is comprised and described info web is carried out to typesetting by the display parameter (such as screen resolution, screen display width, length etc.) of client 1 and remove annotation in described info web, unnecessary space and attribute etc.; And/or the external linkage of being rewritten in described info web is reduced to original external linkage.
The webpage optimization device 6 that the present embodiment provides can be used the webpage optimization method in aforementioned correspondence, and details, referring to the associated description of the corresponding embodiment of above-mentioned webpage optimization method Fig. 2 to Fig. 5, do not repeat them here.
Fig. 7 shows the composition structure of the webpage segmenting device that another embodiment of the present invention provides, and for convenience of explanation, only shows the part relevant to the embodiment of the present invention.
This webpage optimization device 7 comprises processor 101, receiver 102, transmitter 103 and high-speed cache 104, wherein:
The web-page requests information that described receiver 102 sends be used to receiving client;
Described processor 101, for judging whether high-speed cache 104 exists the corresponding information of web-page requests information received with described receiver 102, if do not exist, sends described web-page requests information by described transmitter 103 to web server;
The info web corresponding with described web-page requests information that described receiver 102 also returns be used to receiving web server, and carry out asynchronous process by 101 pairs of described info webs of described processor, described asynchronous process comprises the cache policy of described info web is revised as to non-buffer memory, and the amended info web of cache policy is sent to described client by described transmitter 103, and by the cache policy of the described info web of described processor 101 judgement, when the cache policy of described info web is non-buffer memory, the described info web of mark is non-buffer memory, and described mark is saved to described high-speed cache 104, when but the cache policy of described info web is buffer memory, described info web is carried out to pre-service, and pretreated info web is saved to described high-speed cache 104.
Further, described processor 101 is also for existing and the corresponding information of described web-page requests information at described high-speed cache 104, and corresponding information is that the described info web of mark is while being the information of non-buffer memory, by described transmitter 103, send described web-page requests information to web server, and receive by described receiver 102 info web corresponding with described web-page requests information that web server is returned, this info web is carried out by described transmitter 103, sending to described client again after pre-service.
Further, described processor 101 is also for existing and the corresponding information of described web-page requests information at described high-speed cache 104, and, when corresponding information is the info web corresponding with described web-page requests information, by described transmitter 103, this info web is sent to described client.
Further, before described transmitter 103 sends to described client by this info web, described processor 101 is also for whether info web described in interval query caching 104 is out of date at preset timed intervals, if expired, the mode by asynchronous process sends described web-page requests information to obtain the up-to-date information of this info web by described transmitter 103 to web server.
In the present embodiment, described pre-service includes but not limited to the processing such as decompression, parsing, rewriting.Wherein said rewriting is processed and is comprised and described info web is carried out to typesetting by the display parameter (such as screen resolution, screen display width, length etc.) of client 1 and remove annotation in described info web, unnecessary space and attribute etc.; And/or the external linkage of being rewritten in described info web is reduced to original external linkage.
In the present embodiment, processor 101 is control centers of webpage optimization device 7, utilize the various piece in the whole webpage optimization device 7 of various interface and connection, the web-page requests information that 101 pairs of described receivers 102 of processor receive is processed (comprise and judge in high-speed cache 104 whether have the info web corresponding with described web-page requests information etc.), and the info web corresponding with described web-page requests information obtained after processing sends to client by described transmitter 103.Optionally, processor 101 can comprise one or more processing units, also can integrated application processor and modem processor, wherein, application processor is mainly processed operating system, user interface and application program etc., and modem processor is mainly processed radio communication.Be understandable that, above-mentioned modem processor also can not be integrated in processor 101.
It should be noted that, it will be appreciated by those skilled in the art that, this webpage optimization device 7 can also comprise display 105 and storer 106, and described display 105 can need for the processing procedure that shows result of determination and data to carry out mutual interface with the user.Described processor 101 is stored in software program and the module of storer 106 by operation, realize the various functions of webpage optimization device 7.Described processor 101 is connected with receiver 102, transmitter 103, high-speed cache 104, display 105 and storer 106 respectively.
It will be understood by those skilled in the art that the composition structure shown in Fig. 7 does not form the restriction to webpage optimization device 7, can comprise the parts more more or less than diagram, or combine some parts, or different parts are arranged.
The webpage optimization device 7 that the present embodiment provides can be used the webpage optimization method in aforementioned correspondence, and details, referring to the associated description of the corresponding embodiment of above-mentioned webpage optimization method Fig. 2 to Fig. 5, do not repeat them here.
In sum, the embodiment of the present invention can reach following beneficial effect: 1) by the cache stores info web, client can be directly from obtaining some required info web described high-speed cache, and do not need all from web server, to obtain at every turn, thereby can effectively improve the speed that client terminal web page loads, reduce web displaying time delay.And due to can be directly from described high-speed cache, obtaining some required info web, thereby do not need all described info web to be carried out to pre-service at every turn, reduced the processing pressure of acting server.In addition, when carrying out buffer memory, do not revise the cache policy of info web, can effectively reduce the mutual frequency of acting server and web server; 2) adopt the asynchronous process mode to process described info web, the transmission that is about to info web is synchronizeed and is carried out with the buffer memory of info web, make client when obtaining info web first, can not affect the efficiency of obtaining first info web, reduce the time delay of web displaying; 3) by the pre-service to info web, the external linkage of being rewritten in described info web can be reduced to original external linkage.By the embodiment of the present invention, can effectively improve the loading velocity of webpage, reduce the time that web displaying postpones, strengthen the experience of user's browsing page, have stronger practicality.
The those skilled in the art can be well understood to, for convenience and simplicity of description, only the division with above-mentioned each functional unit is illustrated, in practical application, can above-mentioned functions be distributed and by different functional units, completed as required, the inner structure that is about to device is divided into different functional units, to complete all or part of function described above.In addition, the concrete title of each functional unit also, just for the ease of mutual differentiation, is not limited to the protection domain of the embodiment of the present invention.The system of foregoing description, the specific works process of processor and unit, can, with reference to the corresponding process in preceding method embodiment, not repeat them here.
In several embodiment that the embodiment of the present invention provides, should be understood that, disclosed system, apparatus and method, can realize by another way.For example, device embodiment described above is only schematic, for example, the division of described module or unit, be only that a kind of logic function is divided, during actual the realization, other dividing mode can be arranged, for example a plurality of unit or assembly can in conjunction with or can be integrated into another system, or some features can ignore, or do not carry out.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, indirect coupling or the communication connection of device or unit can be electrically, machinery or other form.
Described unit as separating component explanation can or can not be also physically to separate, and the parts that show as unit can be or can not be also physical locations, namely can be positioned at a place, or also can be distributed on a plurality of network element.Can select according to the actual needs wherein some or all of unit to realize the purpose of the present embodiment scheme.
In addition, each functional unit in each embodiment of the embodiment of the present invention can be integrated in a controller, can be also that the independent physics of unit exists, and also can be integrated in a unit two or more unit.Above-mentioned integrated unit both can adopt the form of hardware to realize, also can adopt the form of SFU software functional unit to realize.
If the form of SFU software functional unit of usining described integrated unit realizes and during as production marketing independently or use, can be stored in a computer read/write memory medium.Based on such understanding, part or all or part of of this technical scheme that the technical scheme of the embodiment of the present invention contributes to prior art in essence in other words can embody with the form of software product, this computer software product is stored in a storage medium, comprise that some instructions are with so that a computer equipment (can be personal computer, server, or the network equipment etc.) or processor (processor) carry out all or part of step of the described method of each embodiment of the embodiment of the present invention.And aforesaid storage medium comprises: various media that can be program code stored such as USB flash disk, portable hard drive, ROM (read-only memory) (ROM, Read-Only Memory), random access memory (RAM, Random AccessMemory), magnetic disc or CDs.
The above embodiment only, in order to technical scheme of the present invention to be described, is not intended to limit; Although with reference to previous embodiment, the present invention is had been described in detail, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme that aforementioned each embodiment puts down in writing, or part technical characterictic wherein is equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution break away from the spirit and scope of each embodiment technical scheme of the embodiment of the present invention.

Claims (12)

1. the method that webpage is optimized, is characterized in that, described method comprises:
Receive the web-page requests information that client sends;
When in high-speed cache, not existing with the corresponding information of described web-page requests information, send described web-page requests information to web server;
Receive the info web corresponding with described web-page requests information that web server is returned;
Described info web is carried out to asynchronous process, and described asynchronous process comprises:
The cache policy of described info web is revised as to non-buffer memory, and the amended info web of cache policy is sent to described client; And
Judge the cache policy of described info web, carry out corresponding caching process according to judged result.
2. the method for claim 1, is characterized in that, describedly according to judged result, carries out corresponding caching process and comprise:
When the cache policy of described info web was non-buffer memory, the described info web of mark was non-buffer memory, and described mark is saved to described high-speed cache; When but the cache policy of described info web is buffer memory, described info web is carried out to pre-service, and pretreated info web is saved to described high-speed cache.
3. method as claimed in claim 1 or 2, is characterized in that, described method also comprises:
In described high-speed cache, exist and the corresponding information of described web-page requests information, and corresponding information is that the described info web of mark is while being the information of non-buffer memory, to web server, send described web-page requests information, and receive the info web corresponding with described web-page requests information that web server is returned, this info web is carried out sending to described client after pre-service.
4. method as claimed in claim 1 or 2, is characterized in that, described method also comprises:
In described high-speed cache, exist and the corresponding information of described web-page requests information, and corresponding information sends to described client by this info web while being the info web corresponding with described web-page requests information.
5. method as claimed in claim 4, is characterized in that, before this info web was sent to described client, described method also comprised:
Whether out of date according to info web described in the query caching of Preset Time interval, if expired, the mode by asynchronous process sends described web-page requests information to obtain the up-to-date information of this info web to web server.
6. method as described as claim 1 to 5 any one, is characterized in that, described pre-service comprises:
The external linkage of being rewritten in described info web is reduced to original external linkage, and described original external linkage is the external linkage in this info web on web server.
7. the device that webpage is optimized, is characterized in that, described device comprises:
First information receiving element, the web-page requests information sent be used to receiving client;
Information transmitting unit, when at high-speed cache, not having the corresponding information of web-page requests information received with described first information receiving element, send described web-page requests information to web server;
The second information receiving unit, the info web corresponding with described web-page requests information returned be used to receiving web server;
The first processing unit, for described info web is carried out to asynchronous process, described asynchronous process comprises: the cache policy of described info web is revised as to non-buffer memory, and the amended info web of cache policy is sent to described client; And the cache policy that judges described info web, according to judged result, carry out corresponding caching process.
8. device as claimed in claim 7, is characterized in that, described the first processing unit specifically for:
When the cache policy of described info web was non-buffer memory, the described info web of mark was non-buffer memory, and described mark is saved to described high-speed cache; When but the cache policy of described info web is buffer memory, described info web is carried out to pre-service, and pretreated info web is saved to described high-speed cache.
9. install as claimed in claim 7 or 8, it is characterized in that, described device also comprises:
The second processing unit, for at described high-speed cache, there being the corresponding information of web-page requests information received with described first information receiving element, and corresponding information is that the described info web of mark is while being the information of non-buffer memory, to web server, send described web-page requests information, and receive the info web corresponding with described web-page requests information that web server is returned, this info web is carried out sending to described client after pre-service.
10. install as claimed in claim 7 or 8, it is characterized in that, described device also comprises:
The 3rd processing unit, for at described high-speed cache, there being the corresponding information of web-page requests information received with described first information receiving element, and when corresponding information is the info web corresponding with described web-page requests information, this info web is sent to described client.
11. device as claimed in claim 10, is characterized in that, described device also comprises:
Fourth processing unit, for before described the 3rd processing unit sends to described client by this info web, whether out of date according to info web described in the query caching of Preset Time interval, if expired, the mode by asynchronous process sends described web-page requests information to obtain the up-to-date information of this info web to web server.
12. device as described as claim 7 to 11 any one, is characterized in that, described pre-service comprises:
The external linkage of being rewritten in described info web is reduced to original external linkage, and described original external linkage is the external linkage in this info web on web server.
CN201310319834.4A 2013-07-26 2013-07-26 A kind of method and device of front page optimization Active CN103412898B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310319834.4A CN103412898B (en) 2013-07-26 2013-07-26 A kind of method and device of front page optimization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310319834.4A CN103412898B (en) 2013-07-26 2013-07-26 A kind of method and device of front page optimization

Publications (2)

Publication Number Publication Date
CN103412898A true CN103412898A (en) 2013-11-27
CN103412898B CN103412898B (en) 2017-03-01

Family

ID=49605910

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310319834.4A Active CN103412898B (en) 2013-07-26 2013-07-26 A kind of method and device of front page optimization

Country Status (1)

Country Link
CN (1) CN103412898B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103778236A (en) * 2014-01-26 2014-05-07 网宿科技股份有限公司 Webpage data distribution processing method and device as well as webpage generation processing method and device
CN104899228A (en) * 2014-03-07 2015-09-09 中国移动通信集团河北有限公司 Method and device for publishing webpage resources
CN105100099A (en) * 2015-07-29 2015-11-25 北京京东尚科信息技术有限公司 Intelligent watch and website access request processing method thereon
CN105373369A (en) * 2014-08-25 2016-03-02 北京皮尔布莱尼软件有限公司 Asynchronous caching method, server and system
WO2019024754A1 (en) * 2017-08-04 2019-02-07 阿里巴巴集团控股有限公司 Page loading method, device, and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110228318A1 (en) * 2010-03-18 2011-09-22 Fuji Xerox Co., Ltd. Information processing apparatus, information processing system, and computer-readable medium
CN102364461A (en) * 2011-06-30 2012-02-29 广州市动景计算机科技有限公司 Page content data acquisition method and server
CN102868719A (en) * 2012-06-29 2013-01-09 北京奇虎科技有限公司 Network access method and server based on cache
CN103200091A (en) * 2013-03-29 2013-07-10 北京蓝汛通信技术有限责任公司 Anti-interference method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110228318A1 (en) * 2010-03-18 2011-09-22 Fuji Xerox Co., Ltd. Information processing apparatus, information processing system, and computer-readable medium
CN102364461A (en) * 2011-06-30 2012-02-29 广州市动景计算机科技有限公司 Page content data acquisition method and server
CN102868719A (en) * 2012-06-29 2013-01-09 北京奇虎科技有限公司 Network access method and server based on cache
CN103200091A (en) * 2013-03-29 2013-07-10 北京蓝汛通信技术有限责任公司 Anti-interference method

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103778236A (en) * 2014-01-26 2014-05-07 网宿科技股份有限公司 Webpage data distribution processing method and device as well as webpage generation processing method and device
CN104899228A (en) * 2014-03-07 2015-09-09 中国移动通信集团河北有限公司 Method and device for publishing webpage resources
CN105373369A (en) * 2014-08-25 2016-03-02 北京皮尔布莱尼软件有限公司 Asynchronous caching method, server and system
CN105100099A (en) * 2015-07-29 2015-11-25 北京京东尚科信息技术有限公司 Intelligent watch and website access request processing method thereon
WO2019024754A1 (en) * 2017-08-04 2019-02-07 阿里巴巴集团控股有限公司 Page loading method, device, and system
CN109391649A (en) * 2017-08-04 2019-02-26 阿里巴巴集团控股有限公司 The methods, devices and systems of page load

Also Published As

Publication number Publication date
CN103412898B (en) 2017-03-01

Similar Documents

Publication Publication Date Title
EP2653987B1 (en) Displaying web pages without downloading static files
KR102294326B1 (en) Prefetching application data for periods of disconnectivity
KR102354803B1 (en) User apparatus for managing web application and method therefor
CN104754073A (en) Resource access method and device
US10862992B2 (en) Resource cache management method and system and apparatus
CN103412898A (en) Method and device for optimizing webpage
CN103812849A (en) Local cache updating method and system, client and server
US9876846B2 (en) Data transmission
CN102402518A (en) Method and device for accessing webpage
CN103491152A (en) Metadata obtaining method, device and system in distributed file system
CN104572843A (en) Page loading method and device
CN102567339A (en) Method, device and system for acquiring start page
CN109948090B (en) Webpage loading method and device
CN104572822A (en) Method and device for displaying text
WO2014194415A1 (en) Optimizing loading of web page based on aggregated user preferences for web page elements of web page
CN103731493A (en) Page transmission method, device and system
CN104376122A (en) Method and server for browser client side to acquire static files
CN103631625A (en) Data acquisition method, user terminal, server and system
CN103617164A (en) Webpage prefetching method, device and terminal equipment
CN104750730A (en) Display method and display device implemented by browsers
CN105653550A (en) Web page filtering method and device
CN103440281A (en) Method, device and equipment for acquiring download file
CN105404672A (en) Webpage data storage and operation system and method
KR101888846B1 (en) System for cloud streaming service, method of image cloud streaming service using reciprocal cache and apparatus for the same
CN103729440A (en) Method and device for having access to website

Legal Events

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