Summary of the invention
In view of the above problems, the object of this invention is to provide and a kind ofly optimize the method and system of page access based on accessing page request, cannot obtain data that active user access websites produces, cannot make to website the problem of optimizing and revising accordingly fast and targeted specifically to solve website.
According to an aspect of the present invention, provide a kind of method of optimizing page access based on accessing page request, comprising:
In the time that client terminal local does not exist the performance data of Website page to be visited, collect the performance data of the Website page returning in the time of inferior request Website page to be visited;
The performance data of Website page is sent to Website server;
Website server is optimized the website of client-access according to the performance data of Website page.
In addition, preferred scheme, method also comprises:
Obtain the domain name of institute's access websites, when the domain name in domain name and default white list is when the match is successful, check whether client terminal local has the performance data of corresponding Website page;
In the time that client terminal local does not exist the performance data of Website page to be visited, collect when time step of the performance data of the Website page that request is returned during when the access websites page;
In the time that client terminal local has existed the performance data of corresponding Website page, carry out the performance data of Website page to send to Website server step.
In addition, preferred scheme is that the performance data of Website page comprises: the url of the webpage of request, the duration of last requested webpage, client are received the size of the page.
In addition, preferred scheme is, in the time obtaining in described webpage to be visited resource, the performance data of described Website page sent to Website server.
In addition, preferred scheme is, while once accessing described webpage to be visited, the performance data of described Website page added to the expansion field of http request upper, sends to Website server.
According to another aspect of the present invention, provide a kind of system of optimizing page access based on accessing page request, comprising:
Client, in the time that client terminal local does not exist the performance data of Website page to be visited, collects the performance data of the Website page returning in the time of inferior request Website page to be visited; And, the performance data of described Website page is sent to Website server;
Website server, for being optimized the website of described client-access according to the performance data of described Website page.
Preferably, described client comprises: performance data collector unit, performance data judging unit, performance data transmitting element,
Wherein, described performance data judging unit, for obtaining the domain name of described website to be visited, when the domain name in domain name and default white list is when the match is successful, checks whether client terminal local has the performance data of corresponding Website page;
In the time that client terminal local does not exist the performance data of Website page to be visited, described performance data collector unit is collected the performance data of the Website page returning in the time of inferior request Website page to be visited;
In the time that described client terminal local has existed the performance data of corresponding Website page, the performance data of described Website page is sent to described Website server by described performance data transmitting element.
Preferably, the performance data of described Website page comprises: the url of the webpage of request, the duration of last requested webpage, client are received the size of the page.
Preferably, in the time obtaining in described webpage to be visited resource, the performance data of described Website page is sent to described Website server by described performance data transmitting element.
Preferably, upper, while once accessing described webpage to be visited, described performance data transmitting element adds the performance data of described Website page the expansion field of http request, sends to described Website server.
From technical scheme above, the method and system of optimizing page access based on accessing page request provided by the invention, access situation based on client user, obtain the data that active user access websites produces, and can fast and targeted specifically website be made accordingly and being optimized and revised, promote client user's experience.
In order to realize above-mentioned and relevant object, one or more aspects of the present invention comprise below by the feature that describes in detail and particularly point out in the claims.Explanation below and accompanying drawing describe some illustrative aspects of the present invention in detail.But, the indication of these aspects be only some modes that can use in the variety of way of principle of the present invention.In addition, the present invention is intended to comprise all these aspects and their equivalent.
Embodiment
In the following description, for purposes of illustration, for the complete understanding to one or more embodiment is provided, many details have been set forth.But, clearly, also can in the situation that there is no these details, realize these embodiment.
Website based on aforementioned proposition cannot obtain active user access websites produce data, cannot make to website the problem of optimizing and revising accordingly fast and targeted specifically, the present invention proposes a set of mechanism by browser feedback information of setting up, thinking of the present invention is expansion http request content, the data that browser access website produces can be fed back by the parameter of request, the specific website of browser access, can submit performance response request to, Website server returns to network, performance, the failure correlation parameter when time browser according to request.And next browser is again when access websites, can attach the page, the performance relevant parameter of this website of last access, Website server judges the variation of user's real time access web site performance according to these parameters, and changes according to these access that carrys out optimizing user.
The method and system of optimizing page access based on accessing page request provided by the invention, compared with prior art, the present invention is according to accessing page request, the full-range data feedback of accession page is provided, so that being provided, website optimizes the Data support of access, thereby meet to greatest extent the needs of user terminal obtaining information resource, and promote user's experience.And the present invention has larger adaptability, and can solve existing insurmountable problem: i.e. the true access situation based on user, is optimized in real time.
Below with reference to accompanying drawing, specific embodiments of the invention are described in detail.
Fig. 1 shows the method flow based on accessing page request optimization page access according to the embodiment of the present invention.
As shown in Figure 1, the invention provides a kind of method of optimizing page access based on accessing page request, comprise: S110: in the time that client terminal local does not exist the performance data of Website page to be visited, collect the performance data of the Website page returning in the time of inferior request Website page to be visited; S120: the performance data of Website page is sent to Website server; S130: Website server is optimized the website of client-access according to the performance data of Website page.
In above-mentioned steps S110, particularly, in the process of the performance data of the Website page returning in the time of inferior request Website page to be visited recording at client collection browser, the performance data of Website page comprises: the url of the webpage of request, the duration of last requested webpage, client are received the size of the page.
The performance data of collecting comprises and is singly not limited to following aspect: time of record request main document, record time, the time of recording the longest loading resource in website, page display performance data, specific webpage and browser record request website mistake that all resources in website have loaded, as the mistakes such as 500.
Wherein, main document generally refers to html document, also referred to as Website page, the page is first mainly text, record instruction label in text, and the label of the browser resolves page is shown, Gains resources (picture, js etc.), finally demonstrates them with the form of Website page.Broadly, main document also comprises xhtml, wml etc., can be understood as the Website page of different markup languages.
Page display performance data comprise the time that time that the page is all over the screen and full page have been shown.
Specific webpage, recording user is browsed behavior (for example a page is very long, and user has browsed to close again, and still browses to half and just closes).
It should be noted that, in the present invention, obtain based on browser in the process of page displaying, obtain relevant data and feed back to website, to help website to improve.General browser loading procedure is:
Browser sends request url-> and obtains the displaying of page main document-> parsing main document-> Gains resources (CSS, JS, picture)-> page;
Wherein, when obtaining relevant data and feeding back to website, the related data of mainly obtaining comprises:
1) network request record consuming time, for example, the Gains resources time consuming time, the moment of sending request server and obtain data from browser, to the duration record of receiving between moment of partial data response.
2) the browser resolves page is shown the time, and for example, browser is getting after main document, resolves the record of duration, and browser is at the handling duration record having loaded after the js resource of the page.And final, the page need to show user to see, this is to have the time of having recorded explanation, having shown so.
3) mistake is also a kind of data, for example, when after certain link of user requests webpage, receives when http return code is 504 replys, and is recorded in local record, while once asking this website, brings the record of correspondence upper.
Fig. 2 shows the method idiographic flow based on accessing page request optimization page access according to the embodiment of the present invention.
As shown in Figure 2, in the present invention, optimize the method for page access based on accessing page request, specifically comprise:
S210: obtain the domain name of institute's access websites, when the domain name in domain name and default white list is when the match is successful, check whether client terminal local has the performance data of corresponding Website page.Particularly, in the present invention, the domain name of the website of the acquisition request client-access by client-access Website page, mates domain name with the domain name in default white list, if the match is successful, check whether client terminal local has the performance data of corresponding Website page.
It should be noted that, client is in the time of the access websites page, the request of blocker interception client, and domain name in the white list that the domain name of the website of client-access is obtained with browser is mated, if the domain name of the website of client-access is present in the domain name in the white list that browser obtains, the match is successful for domain name, otherwise it fails to match; If it fails to match, client is carried out common request to website, because common request is the common practise of this area, does not elaborate in the present invention; If the match is successful, will proceed in the present invention to carry out.Wherein, client, in the time of the same Website page of access, can be sent request at least one times.
It should be noted that in addition, in the present invention, only Data Collection coupling are carried out in the website in white list, browser judges when the domain name of the website of current accessed is the domain name in white list, records and upload record performance data processing.Wherein, in browser, add the white list mechanism of collecting data:
1) browser is supported background service, and browser regularly obtains white list, being realized synchronously, be upgraded by service propelling movement mode;
2) browser can pattern be opened this pattern, also can activate arranging to provide in the page, and the open and close of function can have user to carry out.
Wherein, the authority of white list and scope comprise: open or close Data Collection and feedback, control which domain name is carried out data record, controlled domain name is recorded to which data.
S220: in the time that client terminal local does not exist the performance data of Website page to be visited, collect the S110 step of the performance data of the Website page returning in the time of inferior request Website page to be visited.Particularly, in the present invention, in the time there is not the performance data of corresponding Website page in client terminal local, collect the performance data of the Website page when inferior request of the client of browser record, and be saved to client terminal local, and the performance data of Website page is the performance data of the Website page of Website page while returning.
Wherein, it should be noted that, in the time collecting the performance data of Website page, adopt the method for abovementioned steps S110, the url of the webpage of the request of collecting, the duration of last requested webpage, the size that client is received the page.
S230: in the time that client terminal local has existed the performance data of corresponding Website page, carry out the performance data of Website page to send to Website server S130 step.
Particularly, in the present invention, in the time that client terminal local has existed the performance data of corresponding Website page, in http request, increase the expansion field of http request, then the http request that has increased expansion field is sent to Website server.The performance data of the Website page producing when wherein, the expansion field of increase comprises client terminal local already present last time of requests for page.
That is to say, client while once accessing webpage to be visited, adds the performance data of Website page the expansion field of http request upper, sends to described Website server.
It should be noted that, when client terminal local has existed the performance data of the corresponding webpage and website page; Time, when namely client is asked Website page again; And client is utilized the negotiation characteristic of http agreement, send and there is the http request of expanding field.
Wherein, the expansion field of http request comprises the performance data of the already present corresponding Website page of client terminal local.Performance response request field comprises: the request url of self-defined bef_url(representative record), self-defined bef_time(represents the consuming time of requests for page last time).
Particularly, in the present invention, Website server is receiving after the http request that has increased expansion field, by the expansion field comprising in identification http request, the performance data that the http that acquisition is recorded asks; According to the performance data of record, website is optimized.
It should be noted that, in the present invention, in the time obtaining in webpage to be visited resource, the performance data of Website page is sent to Website server.That is to say, client can be asking, in Website page to be visited, to obtain resource in webpage to be visited when time (first); Also can be once to ask in Website page to be visited upper, obtain resource in described webpage to be visited.That is to say, because client when same Website page, can produce the request of one or many in request, be exactly in client when the resource at upper once requests for page or the page so send the triggered time of last record data.
In the present invention, performance-relevant data are recorded in client terminal local, in the present invention, complete the displaying of a page, browser need to send repeatedly request, be that js(of every loading is writing a Chinese character in simplified form of JavaScript, be a kind of based on object and event-driven and there is the client script language of relative safety), css(Cascading Style Sheet) and image(picture) be all a request, so, the performance data getting, can be in the request of Gains resources, pass to Website server, also can (be user's one click page link that sets out in upper once user clicks on links, reload the operation of a page) time, the performance data of record is uploaded.Therefore the time that sends last record data is can be by client control.More than statement is when these data to be passed to Website server.
Wherein, the consuming time and Website page performance data of the response of the packet purse rope station ip of http request, request url, website; Website ip is by dns(Domain Name Service, domain name system) obtain after resolving, request url is necessary comprising in the data of http request, and ask consuming time, page performance, these are exactly concrete data record.
Particularly, Website server is received after the http request of client, by identifying the record data in http request, can obtain ip, ask url, respond the data such as consuming time and page performance, website or website operation personnel can be optimized website according to actual data, automatically realize the optimization process of Website server.
It should be noted that for different websites or actual demand, the performance data of collection is not exclusively the same; Take access Sina website as example, browser can record or collect following performance data:
1) obtain the main document time;
2) user has loaded all resource time of the page;
3), in the page, load resource and the time the most consuming time.
Sina website is by collection analysis data, find that the speed of this user's access is far below the speed of last visit, accessing IP address in conjunction with user judges, discovery is compared last calling party IP section and variation has been occurred (such as user browses web sites in movement, he does not exit browser during this time, under these circumstances, the server zone acquiescence of originally distributing does not change), user is forwarded to, velocity optimal mirror image server that match with its IP section, thereby realize the speed of rapid Optimum user access websites.
4) collect page fault
In the present invention, mistake is collected in website; Enter the page take active user and return to 40x, 50x mistake as example:
In the time that user asks corresponding website to occur 40x, 50x mistake, in the time asking normal domain name next time, bring the error logging of last time, as this also returns to mistake, only record is last.
Website can be by special interface list formal output 40x, 50x error message, and website maintenance personnel can understand between the content regions of website mistake page URL and correspondence fast by these information, realize and more efficiently understanding and problem analysis.
5) collect browsing pages progress
When a user is in the time browsing a page, in the time browsing to 60%, click page link A, during with the complete browsing pages of user, then click page link A, statistics now.
In the present invention, can also expand further, can get the special field value that last server returns, in upper request once, return to website, can obtain some as the information such as network agent, buffer memory, facilitate inquiry problem.
Corresponding with said method, the present invention also provides a kind of system of optimizing page access based on accessing page request, and Fig. 3 shows the system logic structure based on accessing page request optimization page access according to the embodiment of the present invention.
As shown in Figure 3, the system 300 of optimizing page access based on accessing page request provided by the invention, comprises client 310 and Website server 320;
Client 310, in the time that client terminal local does not exist the performance data of Website page to be visited, collects the performance data of the Website page returning in the time of inferior request Website page to be visited; And, the performance data of described Website page is sent to Website server 320;
Website server 320, is optimized for the website of described client 310 being accessed according to the performance data of described Website page.
The system of optimizing page access based on accessing page request provided by the invention, access situation based on client user, obtain the data that active user access websites produces, and can fast and targeted specifically website be made accordingly and being optimized and revised, promote client user's experience.
Fig. 4 is the system logic block diagram of client in the system based on accessing page request optimization page access, and described client 310 comprises: performance data collector unit 311, performance data judging unit 312, performance data transmitting element 313,
Wherein, described performance data judging unit 312, for obtaining the domain name of described website to be visited, when the domain name in domain name and default white list is when the match is successful, checks whether client terminal local has the performance data of corresponding Website page; In the time that client 310 this locality do not exist the performance data of Website page to be visited, described performance data collector unit 311 is collected the performance data of the Website page returning in the time of inferior request Website page to be visited; In the time that described client terminal local has existed the performance data of corresponding Website page, the performance data of described Website page is sent to described Website server 320 by described performance data transmitting element 313.
Preferably, the performance data of described Website page comprises: the url of the webpage of request, the duration of last requested webpage, client are received the size of the page.
Preferably, in the time obtaining in described webpage to be visited resource, the performance data of described Website page is sent to described Website server 320 by described performance data transmitting element 313.
Preferably, upper, while once accessing described webpage to be visited, described performance data transmitting element 313 adds the performance data of described Website page the expansion field of http request, sends to described Website server 320.
Can find out by above-mentioned execution mode, the method and system of optimizing page access based on accessing page request provided by the invention, access situation based on client user, obtain the data that active user access websites produces, and can fast and targeted specifically website be made accordingly and being optimized and revised, be optimized in real time, thereby meet to greatest extent the needs of user terminal obtaining information resource, promote client user's experience.
The method and system based on accessing page request optimization page access that propose according to the present invention have been described in the mode of example above with reference to accompanying drawing.But, it will be appreciated by those skilled in the art that the method and system based on accessing page request optimization page access that propose for the invention described above, can also on the basis that does not depart from content of the present invention, make various improvement.Therefore, protection scope of the present invention should be determined by the content of appending claims.