Summary of the invention
In view of this, it is an object of the invention to provide a kind of method and device improving web page browsing speed.
For achieving the above object, the present invention provides technical scheme as follows:
A kind of method improving web page browsing speed, is applied in web proxy gateway, it is characterised in that
Described method includes:
When receiving the http request that browser sends, obtain the html file that described http request is corresponding;
Described html file is resolved, obtains the same domain name page unit cited in described html file
Element, and obtain the first quantity of described same domain name page elements;
When described first quantity is more than pre-determined threshold, described html file is modified, by described same
The url of the second quantity page elements in domain name page surface element is modified to point to other web proxy gateway,
Wherein, described second quantity is the difference of described first quantity and described pre-determined threshold, described to described html
File is modified and is included revising the url connection of element in the html page;
Amended html file is sent to browser, so that browser is from multiple web proxy gateway
The described same domain name page elements of middle acquisition.
Above-mentioned method, wherein, described pre-determined threshold is the browser concurrent connection number threshold to same domain name
Value.
Above-mentioned method, wherein, also includes: from the User-Agent of the http head of described http request
Field obtains the browser concurrent connection number threshold value to same domain name.
Above-mentioned method, wherein, also includes: receiving and preserving user configured need to carry out many domain names and add
First element type of the page elements of speed;
Same domain name page elements cited in described acquisition described html file is: obtain described html literary composition
Cited in part, element type is the same domain name page elements of described first element type.
Above-mentioned method, wherein, the quantity of other web proxy gateway described is one or more, and often
The quantity of the page elements corresponding to individual web proxy gateway is less than or equal to described pre-determined threshold.
A kind of device improving web page browsing speed, is applied in web proxy gateway, and described device includes:
First acquiring unit, during for receiving the http request of browser transmission, obtaining described http please
Seek corresponding html file;
Second acquisition unit, for resolving described html file, obtains described html file institute
The same domain name page elements quoted, and obtain the first quantity of described same domain name page elements;
Html file modification unit, for when described first quantity is more than pre-determined threshold, to described html
File is modified, and is revised by the url of the second quantity page elements in described same domain name page elements
For pointing to other web proxy gateway, wherein, described second quantity is that described first quantity is preset with described
The difference of thresholding, described modify described html file includes revising the url of element in the html page
Connect;
Transmitting element, for being sent to browser by amended html file, so that browser is from many
Individual web proxy gateway obtains described same domain name page elements.
Above-mentioned device, wherein, described pre-determined threshold is the browser concurrent connection number threshold to same domain name
Value.
Above-mentioned device, wherein, also includes: the 3rd acquiring unit, for from the http of described http request
The User-Agent field of head obtains the browser concurrent connection number threshold value to same domain name.
Above-mentioned device, wherein, also includes dispensing unit, is used for receiving and preserve user configured needs
Carry out the first element type of the page elements of many domain names acceleration;
Described second acquisition unit is further used for: obtain cited in described html file, element type
Same domain name page elements for described first element type.
Above-mentioned device, wherein, the quantity of other web proxy gateway described is one or more, and often
The quantity of the page elements corresponding to individual web proxy gateway is less than or equal to described pre-determined threshold.
Compared with prior art, the present invention need not source station increases domain name or amendment source code, but passes through
Web proxy gateway is revised the url of page elements in the html page connect, increase browser simultaneously
The domain name number accessed, thus improve browser parallel downloading performance, and then improve web page browsing speed.
Detailed description of the invention
Below in conjunction with accompanying drawing, the embodiment of the present invention is described in detail.
Fig. 1 is the system construction drawing improving web page browsing speed according to an embodiment of the invention.Reference
Fig. 1, described system may include that browser, multiple web proxy gateway (figure shows 3,
Server and 2 domain-name extension servers are rewritten including 1 dynamic many domain name) and web server (source
Stand), web proxy gateway is between browser and web server.Wherein, browser is arranged on visitor
In the end of family, browser refers to show the html file content of web server or file system, and
Allow a kind of software of user and these file interactions, can be the browsers such as IE, firefox, chrome.
Browser mainly alternately and obtains webpage by http agreement and web server, and these webpages are by unifying money
Source location symbol (url) is specified, and file format is usually html, and is indicated in http agreement by MIME.
Client can be wired or wireless communication device, and such as, computer, mobile phone, individual digital help
Reason (PDA) etc..In web server, storage has one or more webpage.
Web proxy gateway is a kind of reverse proxy, and browser can obtain web by web proxy gateway
Webpage in server, say, that (such as http please to the page request of web server for browser
Ask) web proxy gateway can be arrived first at, web proxy gateway the page request of browser is rung
Should, such as return to browser after obtaining webpage from web server or local cache.In the present invention
In embodiment, html file can also be modified by web proxy gateway so that browser can be from many
Individual web proxy gateway obtains the multiple same domain name page elements in same webpage.
Specifically, it is to be connected by the url of element in the amendment html page to increase in web proxy gateway
Add browser access domain concrete number simultaneously, improve browser parallel downloading performance.Further, it is also possible to according to
Http page elements type arranges concurrent domain concrete number, and as picture uses many domain names, video uses single domain name etc..
Further, it is also possible to according to different browsers, different concurrent domain concrete number is set, thus play browser
Best performance.
Implementing of web proxy gateway given below.
Fig. 2 is the structure drawing of device improving web page browsing speed according to an embodiment of the invention.Described
Device is applied in web proxy gateway (DDNS in Fig. 1 rewrites server), obtains including first
Take unit 10, second acquisition unit 20, html file modification unit 30 and transmitting element 40.
The operation principle of this device is:
When first acquiring unit 10 receives the http request that browser sends, can obtain described http please
Seek corresponding html file.First acquiring unit 10 receive browser send http request time,
Can first judge whether caching exists the html file that this http request is corresponding, if so, obtain from caching
Take described html file;Otherwise, obtain described html file from source station (web server), and will
The html file got adds (if the html file that can cache) in caching to.
Described html file is resolved by second acquisition unit 20, obtains cited in described html file
Same domain name page elements, so-called refer to domain name page elements, the url of multiple page elements point to
One domain name.Second acquisition unit 20 obtains the page unit that described same domain name page elements includes the most further
First quantity of element.
Html file modification unit 30 first determines whether whether described first quantity is more than pre-determined threshold, if institute
State the first quantity and be more than pre-determined threshold, then described html file is modified, by the described same domain name page
The url of the second quantity page elements in element is modified to point to other web proxy gateway, wherein,
Described second quantity is the difference of described first quantity and described pre-determined threshold.Such as, in FIG, dynamically
Domain name rewrite server receive described html request, and get correspondence html file after to described
Html file is rewritten, and the url of partial page element therein is modified to point to two other domain name
Expansion service device.If described first quantity is less than or equal to pre-determined threshold, html file is not carried out above-mentioned
Amendment, is directly sent it to browser by transmitting element 40.
Wherein, the quantity of other web proxy gateway described is one or more, alternatively, and each web
The quantity of the page elements corresponding to proxy gateway is less than or equal to described pre-determined threshold.It is to say, html
When url is modified by file modification unit 30, multiple web proxy gateway can be modified to point to,
And the access of each proxy gateway still can be followed the restriction of number of concurrent by browser.
Transmitting element 40 is for being sent to browser by amended html file.Browser receives to be repaiied
After html file after changing, described html file is resolved, is found to have partial page element
Url (url of unmodified) is directed to source station, then initiates the request to this page elements to source station,
This request can arrive web proxy gateway (DDNS in Fig. 1 rewrites server);Browser is also sent out
The url of existing partial page element points to other web proxy gateway (the domain-name extension server in Fig. 1),
Then the request to this page elements is initiated to other web proxy gateway.So, browser just can be from
Multiple web proxy gateway obtain described same domain name page elements, is equivalent to add browser and visits simultaneously
The domain name number asked, thus improve the parallel downloading performance of browser.
In the above-described embodiments, described pre-determined threshold can be the browser concurrent connection number to same domain name
Threshold value.
Alternatively, described device also includes the 3rd acquiring unit (not shown), for asking from described http
The User-Agent field of the http head asked obtains the browser concurrent connection number threshold value to same domain name.
Such as, for IE browser, can get this threshold value from User-Agent field is 4, for firefox
Or chrome browser, can get this threshold value from User-Agent field is 6.It is to say,
In the embodiment of the present invention, different concurrent domain concrete number can be set according to different browsers, thus play and browse
Device optimum performance.
Alternatively, described device also includes dispensing unit (not shown), is used for receiving and preserve user and joins
The first element type needing to carry out the page elements of many domain names acceleration put.Now, described second obtain
Unit 20 is further used for: obtaining cited in described html file, element type is described first yuan
The same domain name page elements of element type.It is to say, in embodiments of the present invention, user can be according to http
Page elements type arranges concurrent domain concrete number, and as picture uses many domain names, video uses single domain name etc..
Fig. 3 is the method flow diagram improving web page browsing speed according to an embodiment of the invention, application
In web proxy, with reference to Fig. 3, described method may include that
Step 301, when receiving the http request that browser sends, obtains described http request corresponding
Html file;
Step 302, resolves described html file, obtains the same area cited in described html file
Name page elements, and obtain the first quantity of described same domain name page elements;
Step 303, when described first quantity is more than pre-determined threshold, modifies to described html file,
The url of the second quantity page elements in described same domain name page elements is modified to point to other web
Proxy gateway, wherein, described second quantity is the difference of described first quantity and described pre-determined threshold;
The quantity of other web proxy gateway described is one or more.Alternatively, each different web agent net
The quantity of the page elements corresponding to pass is less than or equal to described pre-determined threshold.
Described pre-determined threshold can be the browser concurrent connection number threshold value to same domain name, it is possible to from institute
The User-Agent field of the http head stating http request obtains the browser concurrently connection to same domain name
Number threshold value.
Step 304, is sent to browser by amended html file, so that browser is from multiple
Web proxy gateway obtains described same domain name page elements.
Alternatively, described method also includes: receives and preserves user configured needs and carry out the acceleration of many domain names
The first element type of page elements.Now, the same domain name cited in described acquisition described html file
Page elements is: obtaining cited in described html file, element type is described first element type
With domain name page elements.
One application example of the present invention following (with reference to Fig. 1):
In FIG, dynamic many domain names rewrite server and domain-name extension server is all to operate in reverse http
Proxy mode.If not carrying out dynamic many domain-name extension, browser access www.abc.com website is all
Server is rewritten, it is assumed that the page has 9 picture pic1~pic9.jpg, and browses by dynamic many domain names
Device is 3 to the concurrently restriction of same domain name, then want to demonstrate that page browser can only be with at present
Carrying 3 pictures, point 3 batches have been downloaded.
As reverse proxy, the dns of www.abc.com is resolved to dynamic many domain names and rewrites server, from
And dynamic many domain names rewrite that server can get the GET html page that browser initially sends please
Ask, from the User-Agent field of HTTP head, may determine that the type of browser, permissible in this example
Know that browser is 3 to a domain name maximum number of concurrent.
Dynamic many domain names are rewritten server and from source station or are read html content of pages from caching, resolve
Page-out exists 9 pictures, and configures picture in (configuration that user can revise) and be set to many
Domain name is accelerated, and dynamic many domain names are rewritten server and these 9 pictures are evenly distributed to 3 domain names expansions
On exhibition server (rewriting server can be one of them).
As follows to the rewrite method of the html page:
Url:www.abc.com/pic1~pic3.jpg of first three picture, does not rewrites, and so browses
Device also can access dynamic many domain names and rewrite server;
By url:www.abc.com/pic4~pic6.jpg of the 4 to 6th picture, it is rewritten as respectively
S1.foo.com/pic4~pic6.jpg?Domain=www.abc.com, such browser can access
This station server of s1.foo.com obtains picture, and s1 server can be from caching or go back to source station and obtain corresponding
Picture returns to browser;
Equally, by url:www.abc.com/pic7~pic9.jpg of the 7 to 9th picture, rewrite respectively
For s2.foo.com/pic7~pic9.jpg?Domain=www.abc.com, s2 server can from caching or
Person returns source station acquisition picture and returns to browser;
Through above-mentioned amendment, the access of browser becomes three domain names from a domain name, simultaneously and concurrently downloads
Number increases to 9 from 3, significantly increases the download performance of browser.
It should be noted that can such as be provided with one group of calculating in the step shown in the flow chart of accompanying drawing
The computer system of machine executable instruction performs, and, although show that logic is suitable in flow charts
Sequence, but in some cases, can be to be different from the step shown or described by order execution herein
Suddenly.It addition, those skilled in the art should be understood that each module of the above-mentioned present invention or each step can
To realize with general calculating device, they can concentrate on single calculating device, or distribution
On the network that multiple calculating devices are formed, alternatively, they can be with calculating the executable journey of device
Sequence code realizes, and performs it is thus possible to be stored in storing in device by calculating device, or
They are fabricated to each integrated circuit modules by person respectively, or by the multiple modules in them or step system
It is made single integrated circuit module to realize.So, the present invention is not restricted to any specific hardware and soft
Part combines.
The foregoing is only presently preferred embodiments of the present invention, not in order to limit the present invention, all at this
Within the spirit of invention and principle, any modification, equivalent substitution and improvement etc. done, should be included in
Within the scope of protection of the invention.