CN103281387B - Method, server, client side and system for processing child resources in web page - Google Patents

Method, server, client side and system for processing child resources in web page Download PDF

Info

Publication number
CN103281387B
CN103281387B CN201310214937.4A CN201310214937A CN103281387B CN 103281387 B CN103281387 B CN 103281387B CN 201310214937 A CN201310214937 A CN 201310214937A CN 103281387 B CN103281387 B CN 103281387B
Authority
CN
China
Prior art keywords
child resource
response message
webpage
server
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201310214937.4A
Other languages
Chinese (zh)
Other versions
CN103281387A (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.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing 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 Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201310214937.4A priority Critical patent/CN103281387B/en
Publication of CN103281387A publication Critical patent/CN103281387A/en
Application granted granted Critical
Publication of CN103281387B publication Critical patent/CN103281387B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a method, server, client side and system for processing child resources in a web page. The method comprises the steps that the server transmits requests sent by the client side for carrying out web page access to a website, wherein the web page belongs to the website, receives response messages returned by the website, and judges whether the child resources of the web page are cached in the server or not; if the child resources of the web page are not cached, the server transmits the response messages to the client side and caches the child resources according to the magnitude of the child resources of the web page in the response messages; if the child resources of the web page are cached, the server carries out modification on received response messages according to the cached child resources and enables the client side to obtain the child resources through the modified response messages. According to the method, server, client side and system, the problems that the transmission speed of the child resources and the display speed of the web page are low caused by the fact that when the magnitude of the child resources in the web page is not suitable, transmission of the child resources is carried out through a communication transmission link between the client side and the web site can be resolved, and the advantages of improving the display speed of the web page and saving the band width of the web site are achieved.

Description

Process method, server, client and the system of child resource in webpage
Technical field
The present invention relates to computer network communication technology field, and in particular to a kind of method of child resource in process webpage, Server, client and system.
Background technology
In prior art, the framework related to terminal browser is C/S(Client/server, Client/Server)Frame Structure.In this kind of framework, as rendering engine is carried in the terminal browser of client, when client request accession page, and And during server back page resource, the rendering engine of client is locally carrying out page rendering.In this framework, server (also referred to as " high in the clouds "), the processing module usually acted on behalf of plus cache.The request of client is sent to website by server, and The response returned from website is back to client also by server, client the return for receiving server info web it Afterwards, can be rendered by browser renders engine, so as to the page after rendering is presented.
Many seed resources, such as CSS can be included in webpage(Style design table, also referred to as Cascading Style Sheet, Cascading Style Sheet)Child resource and Javascript(Script file)Child resource etc..CSS is for carrying out webpage Style arranges data used.The display properties of each mark in webpage can uniformly be arranged by CSS.Can be more using CSS Plus webpage appearance is effectively set, specifically, can accurate named web page element position, expand outward appearance and create special effect Really.JavaScript is a kind of script of lightweight, is to can be inserted into html(Hypertext Markup Language, surpass Text mark up language)The programming code of the page.After the JavaScript insertion html pages, can be performed by browser.The html pages In script must be positioned at<script>With</script>Between label.Script can be placed on the html pages<body>With< head>In part.
Child resource in webpage includes two kinds of forms of internal child resource and outside child resource.For example, used in webpage CSS's mainly includes the external style, by web page interlinkage to external style sheet;Inline style, by CSS embedded web page.Its In, inline style specifically includes interior page pattern again, and embedded CSS, and inline style are created in webpage, and application is embedded Pattern is to each web page element.Used in html webpage, the method for Javascript mainly has two kinds:(1) it is outside Javascript, by web page interlinkage to outside Javacript.(2) interior page Javascript, creates what is be embedded in webpage Javascript。
In the prior art, when client accesses webpage every time, it is required for from website obtaining the child resource in webpage, passes through Communications link between client and website carries out child resource transmission, particularly when outside child resource in webpage or internal son money When the size in source is not suitable for, for example, when the size of outside child resource is too small, it is that its cost for setting up TCP connections is counted with respect to which According to excessive for transmission;When the size of the child resource included inside the webpage is excessive, data transfer during webpage primary resource is downloaded The probability retransmitted after failure increases, and transmission cost increases;Thus, further result in child resource transmission speed slow, webpage represents speed Degree is slow.
The content of the invention
In view of the above problems, it is proposed that the present invention so as to provide one kind overcome the problems referred to above or at least in part solve on State the method for processing child resource in webpage, server, client and the system of problem.
According to one aspect of the present invention, there is provided a kind of method of child resource in process webpage, methods described include:
Client is carried out the request sent by web page access and is transmitted to the website belonging to the webpage by server, receives net Stand return response message, the child resource of the webpage whether has been cached in judging the server;
If the child resource of the uncached webpage in the server, the response letter that the website is returned by server Breath is transmitted to the client, and caches the child resource according to the size of the child resource of webpage in response message;
If the child resource of the webpage has been cached in the server, server is according to the child resource docking for having cached The response message of receipts is modified, and makes client obtain child resource by amended response message.
Wherein, the size according to the child resource of webpage in response message caches the child resource and includes:
The server judges whether to cache the child resource according to the size of the child resource of webpage in response message;
If it is determined that the caching child resource, then carry out de-redundancy to the child resource, cache and go in the server Child resource after redundancy.
Wherein, the size according to the child resource of webpage in response message caches the child resource and includes:
Whether the size of the inside child resource of the webpage that the server is included in judging the response message that website returns is big In equal to the first pre-set threshold value, if it is, extract the inside child resource being cached.
Wherein, the child resource that the basis has been cached is modified to the response message for receiving, and makes client by modification Response message afterwards obtains child resource to be included:
The inside child resource content modification for having cached in response message is sub with the inside of caching by the server Amended response message is sent to client by the corresponding link of resource;
The server receives the child resource request that client sends, according to being linked at the clothes in child resource request The inside child resource of caching is searched in business device, the inside child resource for finding is returned to into the client.
Wherein, the size according to the child resource of webpage in response message caches the child resource and includes:
Whether the size of the outside child resource of the webpage that the server is included in judging the response message that website returns is little In equal to the second pre-set threshold value, if it is, caching the outside child resource.
Wherein, the child resource that the basis has been cached is modified to the response message for receiving, and makes client by modification Response message afterwards obtains child resource to be included:
The server will be revised as what is cached with corresponding the linking of outside child resource for caching in response message Amended response message is sent to client by the outside child resource content.
Wherein, the size according to the child resource of webpage in response message caches the child resource and includes:
The server is recorded after the size according to the child resource of webpage in response message determines the caching child resource The corresponding relation of the child resource of the URL and caching of the webpage.
Wherein, the child resource that the basis has been cached to receive response message modify including:
URL of the server according to the webpage of record and the corresponding relation of the child resource of caching, change the sound for receiving Answer information.
Wherein, the child resource includes style design table CSS child resources and/or script file child resource.
According to an aspect of the invention, there is provided a kind of method for loading the child resource for accessing webpage in client, institute The method of stating includes:
User end to server sends the request for carrying out web page access, and the response message that the reception server is returned, described Response message is the response message that the website belonging to the webpage returns or the server to its amended response message;
Client is parsed to response message, according to child resource in the information acquisition webpage for parsing, and loads the son Resource.
According to another aspect of the present invention, there is provided a kind of server for processing child resource in webpage, the server Including:Proxy module, cache module and child resource optimization module,
The proxy module, is suitable to for client to carry out the request sent by web page access be transmitted to belonging to the webpage Website, receives the response message that website returns, the child resource of the webpage whether has been cached in judging the cache module;
The proxy module, is further adapted for the child resource of the uncached webpage in judged result is the cache module When, the response message of reception is transmitted to into the client;
The child resource optimization module includes:Child resource size analyzes submodule and child resource modification submodule,
The child resource size analyzes submodule, is suitable to the uncached webpage in judged result is the cache module Child resource when, the child resource is cached in the cache module according to the size of the child resource of webpage in response message;
The child resource changes submodule, is suitable to the son of the webpage has been cached in judged result is the cache module During resource, the response message for receiving is modified according to the child resource for having cached, client is made by amended response letter Breath obtains child resource;
The proxy module, is further adapted for the child resource of the webpage has been cached in judged result is the cache module When, child resource modification submodule amended response message is sent to into the client;
The cache module, is suitable to the child resource included by cache web pages.
Wherein, the child resource optimization module also includes de-redundancy submodule,
The de-redundancy submodule, is suitable to after it is determined that caching the child resource, carries out de-redundancy to the child resource, The child resource after de-redundancy is cached in the cache module.
Wherein, the child resource size analyzes submodule, the webpage included in being suitable to the response message for judge website return The size of inside child resource whether be more than or equal to the first pre-set threshold value, if it is, extract the inside child resource delaying described Cached in storing module.
Wherein, the child resource changes submodule, is suitable to repair the inside child resource content for having cached in response message It is changed to link corresponding with the inside child resource of caching;
The proxy module, is suitable to for amended response message to be sent to client, receives the son money that client sends Source is asked, and according to the inside child resource that being linked in the cache module in the child resource request searches caching, will find Inside child resource return to the client.
Wherein, the child resource size analyzes submodule, the webpage included in being suitable to the response message for judge website return The size of outside child resource whether be less than or equal to the second pre-set threshold value, if it is, it is outer in the cache module to cache this Portion's child resource.
Wherein, the child resource changes submodule, and being suitable to will be corresponding with the outside child resource for caching in response message Link be revised as the outside child resource content for having cached;
The proxy module, is suitable to for amended response message to be sent to client.
Wherein, the child resource size analyzes submodule, is suitable in the size according to the child resource of webpage in response message It is determined that after the caching child resource, recording the URL of the webpage and the corresponding relation of the child resource of caching.
Wherein, the child resource changes submodule, and it is right with the child resource of caching according to the URL of the webpage for recording to be suitable to Should be related to, change the response message for receiving.
Wherein, the child resource includes style design table CSS child resources and/or script file child resource.
According to another aspect of the present invention, there is provided a kind of loading accesses the client of the child resource of webpage, the visitor Family end includes:
Communication module, is suitable to server send the request for carrying out web page access, and the response letter that the reception server is returned Breath, the response message are the response message that the website belonging to the webpage returns or the server to its amended response Information;
Parsing module, is suitable to parse response message, according to child resource in the information acquisition webpage for parsing;
Load-on module, is suitable to load the child resource for obtaining.
According to another aspect of the present invention, there is provided a kind of loading accesses the system of the child resource of webpage, the system Including:Described server, and described client.
Technology according to the present invention scheme, server client access webpage when, according to website return response message The size of the child resource of middle webpage caches the child resource;Afterwards when client accesses the webpage again, according to the son for having cached Resource is modified to the response message for receiving, and makes client obtain child resource by amended response message.It is possible thereby to After client accessed a webpage, the size caching of the child resource of webpage in the response message that server is returned according to website The child resource;When client visits again the webpage, child resource is obtained from server buffer, it is to avoid work as outside son in webpage When the size of resource or internal child resource is not suitable for, child resource biography is carried out by the communications link between client and website It is defeated.Thus solve when the size of child resource in webpage is not suitable for, entered by the communications link between client and website Row child resource is transmitted, and causes child resource transmission speed slow, and webpage represents slow-footed problem, is achieved raising webpage and is represented speed Degree, saves the beneficial effect of the communications bandwidth resources of website.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the technological means of the present invention, And can be practiced according to the content of description, and in order to allow the above and other objects of the present invention, feature and advantage can Become apparent, below especially exemplified by the specific embodiment of the present invention.
Description of the drawings
By the detailed description for reading hereafter preferred implementation, various other advantages and benefit are common for this area Technical staff will be clear from understanding.Accompanying drawing is only used for the purpose for illustrating preferred implementation, and is not considered as to the present invention Restriction.And in whole accompanying drawing, it is denoted by the same reference numerals identical part.In the accompanying drawings:
Fig. 1 shows the structure chart of the server for processing child resource in webpage according to an embodiment of the invention;
Fig. 2 shows the structure chart of child resource optimization module according to an embodiment of the invention;
Fig. 3 shows the structure chart of child resource optimization module in accordance with another embodiment of the present invention;
Fig. 4 shows that loading according to an embodiment of the invention accesses the structure chart of the client of the child resource of webpage;
Fig. 5 shows that loading according to an embodiment of the invention accesses the structure chart of the system of the child resource of webpage;
The flow chart that Fig. 6 shows the method for processing child resource in webpage according to an embodiment of the invention;
Fig. 7 shows the side that internal child resource in webpage is converted to outside child resource according to an embodiment of the invention The flow chart of method;
Fig. 8 shows the side that outside child resource in webpage is converted to internal child resource according to an embodiment of the invention The flow chart of method;And
Fig. 9 shows the stream of the method that the child resource for accessing webpage is loaded in client according to an embodiment of the invention Cheng Tu.
Specific embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although the disclosure is shown in accompanying drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure and should not be by embodiments set forth here Limited.On the contrary, there is provided these embodiments are able to be best understood from the disclosure, and can be by the scope of the present disclosure Complete conveys to those skilled in the art.
Referring to Fig. 1, the structure chart of the server for processing child resource in webpage according to an embodiment of the invention is shown. Server 100 includes:Proxy module 110, cache module 120 and child resource optimization module 130.
Proxy module 110, is suitable to for client 200 to carry out the request sent by web page access be transmitted to belonging to the webpage Whether website, receives the response message that website returns, judge in cache module 120 child resource of cache web pages, will determine that knot Fruit is notified to child resource optimization module 130.
Proxy module 110, when being further adapted for the child resource of uncached webpage in judged result is cache module 120, will connect The response message of receipts is transmitted to client 200.
Specifically, entered the forwarding of row information by server 100 between client 200 and website, in cache module 120 During the child resource without cache web pages, after client 200 receives the response message of website return, son money is obtained in the usual way Source.I.e. when child resource is internal child resource, the inside child resource in the response message that website returns, is included, client 200 is solved The response message is analysed, the child resource presented needed for webpage is obtained.When child resource is outside child resource, the response letter that website returns Link comprising the outside child resource in breath, client 200 parse the response message, send and obtain child resource after being linked Request, the proxy module 110 of server 100 forward the request to website, and website returns child resource, server according to the request The child resource that website returns is transmitted to client 200 by 100 proxy module 110.
Referring to Fig. 2, the structure chart of child resource optimization module according to an embodiment of the invention is shown.Child resource optimizes Module 130 includes:Child resource size analyzes submodule 132 and child resource modification submodule 134.
Child resource size analyzes submodule 132, is suitable to the son money of the uncached webpage in judged result is cache module 120 During source, the child resource is cached in cache module 120 according to the size of the child resource of webpage in response message.
Child resource changes submodule 134, is suitable in judged result is cache module 120 child resource of cache web pages When, the response message for receiving is modified according to the child resource for having cached, client 200 is made by amended response message Obtain child resource.
In one embodiment, child resource size analyzes submodule 132 in the child resource according to webpage in response message Size determine cache the child resource after, record webpage URL with caching the child resource corresponding relation.
Child resource changes the corresponding relation of URL of the submodule 134 according to the webpage of record and the child resource of caching, modification The response message of reception.
Proxy module 110, is further adapted for for child resource modification 134 amended response message of submodule being sent to client 200。
Cache module 120, is suitable to the child resource included by cache web pages.
Referring to Fig. 3, the structure chart of child resource optimization module in accordance with another embodiment of the present invention is shown.Child resource is excellent Changing module 130 also includes de-redundancy submodule 136.De-redundancy submodule 136, is suitable to after it is determined that caching child resource, to the son Resource carries out de-redundancy, and the child resource after de-redundancy is cached in cache module 120.
For example, blank character in CSS child resources and Javascript child resources can be got rid of, it is also possible to will Annotate in CSS child resources and Javascript child resources and get rid of.Thereby, it is possible in CSS child resources and Javascript moneys In the case that source is lossless, reaches and CSS child resources and Javascript child resources are optimized, save webpage flow, to webpage Access the effect for accelerating.
In one embodiment, the child resource for including inside the html pages in the response message returned by website When size is excessive, the inside child resource is converted to into outside child resource.
In the present embodiment, client 200 is carried out the request sent by web page access and is transmitted to the net by proxy module 110 The response message that website returns is transmitted to the client 200 by the website belonging to page.
The inside child resource of the webpage that child resource size analysis submodule 132 is included in judging the response message that website returns Size whether be more than or equal to the first pre-set threshold value, if it is, extract the inside child resource being delayed in cache module 120 Deposit.
The inside child resource for having cached in the response message that proxy module 110 is received by child resource modification submodule 134 Content modification is links corresponding with the inside child resource of caching.
Amended response message is sent to client 200 by proxy module 110, receives the son money that client 200 sends Source is asked, according to the inside child resource that being linked in cache module 120 in the child resource request searches caching, by what is found Internal child resource returns to client 200.
For example, when client 200 accesses webpage first, client 200 is carried out web page access by proxy module 110 The request for being sent is transmitted to the website belonging to the webpage, and the response message that website returns is transmitted to the client 200.This Outward, after proxy module 110 receives the response message of website return, child resource size analysis submodule 132 judges that website returns Response message in CSS child resources inside the webpage that includes size whether more than or equal to pre-set threshold value CSSOutlineMinBytes, if it is, extract the CSS child resources being cached in cache module 120.Or, agency After module 110 receives the response message of website return, child resource size analysis submodule 132 judges the response letter that website returns Whether the size of the JavaScript child resources inside the webpage included in breath is more than or equal to pre-set threshold value JsOutlineMinBytes, if it is, extracting the JavaScript child resources, is cached in cache module 120. Above-mentioned process can be made to CSS child resources and JavaScript child resources simultaneously.
When client 200 accesses webpage again, client 200 is carried out what web page access was sent by proxy module 110 Request is transmitted to the website belonging to the webpage, after receiving the response message of website return, indicates child resource modification submodule 134 Modification response message.Child resource change submodule 134 by the CSS child resources for having cached in response message and/or Javascript child resource content modifications are the chain corresponding with the CSS child resources and/or Javascript child resources of caching Connect.Amended response message is sent to client 200 by proxy module 110, and the child resource for receiving the transmission of client 200 please Ask, according to CSS child resources and/or Javascript that being linked in cache module 120 in the child resource request searches caching The CSS child resources for finding and/or Javascript child resources are returned to client 200 by child resource.
So, by above-described embodiment, solve the child resource included inside the webpage size it is excessive when, download webpage The probability retransmitted after data transmission fails during primary resource increases, the problem that transmission cost increases.Therefore, it is possible to obtain in sub- money In the case that the application effect in source is not damaged, increase webpage access speed, reduce server back end website pressure it is beneficial Effect.
In one embodiment, when the html pages in the response message returned by website outside child resource size When too small, the outside child resource is converted to into internal child resource.
In the present embodiment, client 200 is carried out the request sent by web page access and is transmitted to the net by proxy module 110 The response message that website returns is transmitted to the client 200 by the website belonging to page.
The outside child resource of the webpage that child resource size analysis submodule 132 is included in judging the response message that website returns Size whether be less than or equal to the second pre-set threshold value, if it is, the outside child resource is cached in cache module 120.
With the outside child resource for caching in the response message that proxy module 110 is received by child resource modification submodule 134 Corresponding link is revised as the outside child resource content for having cached.
Amended response message is sent to client 200 by proxy module 110.
For example, when client 200 accesses webpage first, the proxy module 110 of server 100 is by client 200 Carry out the request sent by web page access and be transmitted to the website belonging to the webpage, receive the response message that website returns, judge Do not have to cache the child resource in the response message in the cache module 120 of server 100, the response message forwarding that website is returned Give the client 200.Client 200 parses the link of outside child resource from response message, by the son money including the link Source request is sent to server 100, and the proxy module 110 of server 100 forwards a request to website, and website is returned comprising outside The corresponding information is returned to client 200 by the response message of child resource content, proxy module 110.Additionally, proxy module 110 After receiving the response message of website return, the child resource size analysis submodule 132 in child resource optimization module 130 judges net Whether the size of the CSS child resources outside webpage included in the response message for returning of standing is less than or equal to pre-set threshold value CSSInlineMaxBytes, if it is, extract the CSS child resources being cached in cache module 120.Or, Dai Limo After block 110 receives the response message of website return, child resource size analysis submodule 132 judges the response message that website returns In JavaScript child resources outside the webpage that includes size whether less than or equal to pre-set threshold value JsInlineMaxBytes, If it is, extract the JavaScript child resources being cached in cache module 120.Can also be simultaneously to CSS child resources Make above-mentioned process with JavaScript child resources.
When client 200 accesses webpage again, client 200 is carried out webpage visit by the proxy module 110 of server 100 Ask that sent request is transmitted to the website belonging to the webpage, after receiving the response message of website return, child resource optimization mould The child resource modification modification response message of submodule 134 in block 130.Child resource change submodule 134 by response message with The link that the CSS child resources and/or Javascript child resources of the outside of caching are corresponding is revised as the outside for having cached The content of CSS child resources and/or Javascript child resources.Amended response message is sent to client by proxy module 110 End 200.Thus, client 200 directly obtains CSS child resources from the response message after receiving the amended response message And/or Javascript child resources.
So, by above-described embodiment, solve outside child resource when webpage size it is too small when, be which sets up TCP The cost of connection is excessive with respect to for its data transfer so that the problem of the inefficiency of transmission data.Therefore, it is possible to obtain In the case that the application effect of child resource is not damaged, increase webpage access speed, reduce the website pressure of server back end Beneficial effect.
URL is accessed as http with client below:As a example by the webpage of //www.a.com, the server of the present invention is carried out Illustrate.
Wherein, the client 200 can be browser in mobile phone terminal, or PC(PC, Personal Computer)Browser in terminal, or other web access requests sides, here are not particularly limited.
When the request of client 200 accesses http:During //www.a.com, client 200 sends webpage to server 100 and visits Ask request.
Client 200 is carried out the request sent by web page access and is transmitted to the webpage by the proxy module 110 of server 100 Affiliated website.
When client 200 asks to access http first:During //www.a.com, website returns the response message of the webpage and arrives Server 100.
The proxy module 110 of server 100 does not have the child resource for caching the response message in judging cache module 120 Afterwards, the response message is transmitted to into client 200.Then, the child resource size analysis submodule in child resource optimization module 130 132 start to analyze in the page<style>Label and<script>Size text in label, if being more than or equal to The value of CssOutlineMinBytes or JsOutlineMinBytes, then by corresponding child resource content extraction out, to extracting Content first indicate that de-redundancy submodule 136 carries out de-redundancy, then generate in the cache module 120 of server 100 corresponding Child resource caches (such as xxx.b.css and xxx.c.js), and records the corresponding relation of this webpage URL and corresponding child resource.
As the requested webpage http again of client 200:During //www.a.com, the proxy module 110 of server 100 is by visitor Family end 200 carries out the request sent by web page access and is transmitted to the website belonging to the webpage, receives the response message that website returns. According to the webpage URL of record, the proxy module 110 of server 100 judges in cache module 120 there there is in the response message record Child resource.This webpage of child resource modification submodule 134 in the child resource optimization module 130 of server 100 according to record URL and the corresponding relation of child resource, learn the form that outside is converted into the respective inner child resource in this response message, will Corresponding internal child resource is rewritten as the form of outside child resource link, and the cache module 120 before sensing in server 100 is given birth to Into child resource caching (such as xxx.b.css and xxx.c.js).Amended response message is sent to visitor by proxy module 110 Family end 200.Client 200 receives revised response message, sends child resource request to server 100, corresponding to obtain Child resource.Proxy module 110 receives the child resource request that client 200 sends, and being linked in being asked according to the child resource is slow The inside child resource of caching is searched in storing module 120, the inside child resource for finding is returned to into client 200.
When the request of client 200 accesses http:During //www.d.com, client 200 sends webpage to server 100 and visits Ask request.
Client 200 is carried out the request sent by web page access and is transmitted to the webpage by the proxy module 110 of server 100 The response message that website returns is transmitted to the client 200 by affiliated website.
When client 200 asks to access http first:During //www.d.com, website returns the response message of the webpage and arrives Server 100.The proxy module 110 of server 100 does not have the child resource for caching the response message in judging cache module 120 Afterwards, the response message is transmitted to into client 200.After client 200 receives response message, send and obtain child resource (such as Xxx.e.css and xxx.f.js) request.Proxy module 110 forwards the request to website, receives the son money that website returns Source, and the child resource is returned to into client 200.
Meanwhile, the child resource size analysis submodule 132 in the child resource optimization module 130 of server 100 starts analysis The size of each outside CSS child resource and Javascript child resources, when the size for finding certain CSS child resource is less than or equal to CssInlineMaxBytes values find that the size of certain Javascript child resource is less than or equal to JsInlineMaxBytes values When, de-redundancy submodule 136 is indicated by correspondence child resource content de-redundancy, then by the result cache after de-redundancy in server In 100 cache module 120, and record the corresponding relation of this webpage URL and child resource.
When client 200 accesses http again:During //www.d.com, the proxy module 110 of server 100 is by client 200 carry out the request sent by web page access is transmitted to the website belonging to the webpage, receives the response message that website returns.Service According to the webpage URL of record, the proxy module 110 of device 100 judges that record has the son in the response message in cache module 120 Resource.In the child resource optimization module 130 of server 100 child resource modification submodule 134 according to record this webpage URL with The corresponding relation of child resource, learns the form that internal resource should be converted into corresponding certain child resource in this html page, Then the child resource (such as xxx.e.css and xxx.f.js) cached before taking out from cache module 120, then by response letter In breath, in the html pages, the link overwriting of the outside child resource of correspondence is the child resource content taken out from caching, and will be revised Response message returns to client 200.
Thus, by above-mentioned technical proposal, solve when the size of outside child resource or internal child resource in webpage is uncomfortable During conjunction, child resource transmission is carried out by the communications link between client and website, cause child resource transmission speed slow, webpage Represent slow-footed problem, achieve raising webpage and represent speed, save the beneficial effect of the communications bandwidth resources of website.
Referring to Fig. 4, show that the loading of one embodiment of the invention accesses the structure chart of the client of the child resource of webpage. Client 200 includes:Communication module 210, parsing module 220 and load-on module 230.
Communication module 210, is suitable to server 100 send the request for carrying out web page access, and the reception server 100 is returned Response message, the response message be webpage belonging to website return response message or server 100 it is amended to which Response message.
Parsing module 220, is suitable to parse response message, according to child resource in the information acquisition webpage for parsing.
Load-on module 230, is suitable to load the child resource for obtaining.
Referring to Fig. 5, show that loading according to an embodiment of the invention accesses the structure of the system of the child resource of webpage Figure.System includes aforementioned server 100 and multiple aforementioned clients 200.Wherein, can be straight between server 100 and client 200 Connect in succession, it is also possible to which, by network connection, here is not particularly limited.
Referring to Fig. 6, the flow chart for showing the method for processing child resource in webpage according to an embodiment of the invention.Should Method comprises the steps.
Client is carried out the request sent by web page access and is transmitted to the website belonging to webpage by step S610, server, Receive the response message that website returns.Specifically, entered the forwarding of row information by server between client and website.
Whether step S620, server judge in the server child resource of cache web pages, if in the server not The child resource of cache web pages, then execution step S630, if the child resource of cache web pages, execution step in server S640。
The response message that website returns is transmitted to client by step S630, server, and according to webpage in response message The size of child resource cache the child resource.Specifically, when there is no the child resource of cache web pages in the server, client's termination After receiving the response message of website return, child resource is obtained in the usual way.I.e. when child resource is internal child resource, website is returned The inside child resource is included in the response message returned, client parses the response message, obtains the child resource presented needed for webpage. When child resource is outside child resource, the link comprising the outside child resource in the response message that website returns, client parsing The response message, sends the request for obtaining child resource after being linked, server forwards the request to website, and website is according to this Request returns child resource, and the child resource that website returns is transmitted to client by server.
Step S640, server are modified to the response message for receiving according to the child resource for having cached, lead to client Cross amended response message and obtain child resource.
In one embodiment, step S630 includes:Server according in response message the child resource of webpage it is big After little determination caches the child resource, the URL of the webpage and the corresponding relation of the child resource of caching are recorded.Step S640 bag Include:URL of the server according to the webpage of record and the corresponding relation of the child resource of caching, change the response message for receiving.
In another specific embodiment, step S630 also includes:If it is determined that the caching child resource, then to the child resource De-redundancy is carried out, the child resource after de-redundancy is cached in the server.
For example, blank character in CSS child resources and Javascript child resources can be got rid of, it is also possible to will Annotate in CSS child resources and Javascript child resources and get rid of.Thereby, it is possible in CSS child resources and Javascript moneys In the case that source is lossless, reaches and CSS child resources and Javascript child resources are optimized, save webpage flow, to webpage Access the effect for accelerating.
In one embodiment, the child resource for including inside the html pages in the response message returned by website When size is excessive, the inside child resource is converted to into outside child resource.
Show referring to Fig. 7 and according to an embodiment of the invention internal child resource in webpage is converted to into outside child resource Method flow chart.The method comprises the steps.
Step S710, the request of the access webpage that client is sent by server are transmitted to the website belonging to webpage, receive The response message that website returns.
Whether step S720, server judge in the server child resource of cache web pages, if in the server not The child resource of cache web pages, then execution step S730, if the child resource of cache web pages, execution step in server S770。
The response message that website returns is transmitted to client by step S730, server.
Step S740, the size of the inside child resource of webpage that server is included in judging the response message that website returns is It is no to be more than or equal to the first pre-set threshold value, if it is, execution step S750, otherwise, execution step S760.
Step S750, server are extracted the inside child resource and are cached.
Step S760, server are not cached to response message inside child resource.
Step S770, server by the inside child resource content modification for having cached in response message be with caching this is interior Amended response message is sent to client by the corresponding link of portion's child resource.
Step S780, server receive the child resource request that client sends, according to being linked in the child resource request The inside child resource of caching is searched in server, the inside child resource for finding is returned to into client.
For example, when client accesses webpage first, server by client carry out that web page access sent please Ask and be transmitted to website belonging to the webpage, the response message that website returns is transmitted to into the client.Additionally, server is received After the response message that website returns, the size of the CSS child resources inside webpage included in judging the response message that website returns Whether pre-set threshold value CSSOutlineMinBytes is more than or equal to, if it is, extract the CSS child resources carrying out in the server Caching.Or, whether the size of the JavaScript child resources inside webpage included in judging the response message that website returns More than or equal to pre-set threshold value JsOutlineMinBytes, if it is, the JavaScript child resources are extracted, in the server Cached.Above-mentioned process can also be made to CSS child resources and JavaScript child resources simultaneously.
When client accesses webpage again, client is carried out the request sent by web page access and is transmitted to this by server Website belonging to webpage, after receiving the response message of website return, judge to be cached with the CSS child resources and/or Javascript child resources, then repair the CSS child resources for having cached and/or Javascript child resource contents in response message It is changed to the CSS child resources with caching and/or Javascript child resources is corresponding links.Server is by amended response Information is sent to client, receives the child resource request that client sends, according to being linked at server in child resource request The middle CSS child resources and/or Javascript child resources for searching caching, by the CSS child resources for finding and/or Javascript Child resource returns to client.
So, by above-described embodiment, solve the child resource included inside the webpage size it is excessive when, download webpage The probability retransmitted after data transmission fails during primary resource increases, the problem that transmission cost increases.Therefore, it is possible to obtain in sub- money In the case that the application effect in source is not damaged, increase webpage access speed, reduce server back end website pressure it is beneficial Effect.
In one embodiment, when the html pages in the response message returned by website outside child resource size When too small, the outside child resource is converted to into internal child resource.
Show referring to Fig. 8 and according to an embodiment of the invention outside child resource in webpage is converted to into internal child resource Method flow chart.The method comprises the steps.
Step S810, the request of the access webpage that client is sent by server are transmitted to the website belonging to webpage, receive The response message that website returns.
Whether step S820, server judge in the server child resource of cache web pages, if in the server not The child resource of cache web pages, then execution step S830, if the child resource of cache web pages, execution step in server S870。
The response message that website returns is transmitted to client by step S830, server.
Step S840, the size of the outside child resource of webpage that server is included in judging the response message that website returns is It is no to be less than or equal to the second pre-set threshold value, if it is, execution step S850, otherwise, execution step S860.
Step S850, server are extracted the outside child resource and are cached.
Step S860, server are not cached to outside child resource in response message.
Step S870, server will be revised as delaying with corresponding the linking of outside child resource for caching in response message Amended response message is sent to client by the outside child resource content deposited.
For example, when client accesses webpage first, server by client carry out that web page access sent please Ask and be transmitted to website belonging to the webpage.Server receives the response message that website returns, and judges no caching in server The response message that website returns is transmitted to the client by the child resource in the response message.Client is solved from response message The link of outside child resource is separated out, the child resource request including the link is sent to into server, server is forwarded a request to Website, website return the response message comprising outside child resource content, and the corresponding information is returned to client by server.This Outward, after server receives the response message of website return, CSS outside webpage included in the response message that website returns Whether the size of resource is less than or equal to pre-set threshold value CSSInlineMaxBytes, if it is, extracting the CSS child resources in clothes Cached in business device.Or, after server receives the response message of website return, in judging the response message that website returns Comprising webpage outside the size of JavaScript child resources whether be less than or equal to pre-set threshold value JsInlineMaxBytes, such as Fruit is then to extract the JavaScript child resources to be cached in the server.Can also simultaneously to CSS child resources and JavaScript child resources make above-mentioned process.
When client accesses webpage again, client is carried out the request sent by web page access and is transmitted to this by server Website belonging to webpage, receives the response message of website return.Server by response message with the CSS of outside for caching The corresponding link of child resource and/or Javascript child resources be revised as the CSS child resources of the outside for having cached and/or The content of Javascript child resources.Amended response message is sent to client by server.Thus, client is received After the amended response message, CSS child resources and/or Javascript child resources are directly obtained from the response message.
So, by above-described embodiment, solve outside child resource when webpage size it is too small when, be which sets up TCP The cost of connection is excessive with respect to for its data transfer so that the problem of the inefficiency of transmission data.Therefore, it is possible to obtain In the case that the application effect of child resource is not damaged, increase webpage access speed, reduce the website pressure of server back end Beneficial effect.
URL is accessed as http with client below:As a example by the webpage of //www.a.com, the server of the present invention is carried out Illustrate.
Wherein, the client can be browser in mobile phone terminal, or PC(PC, Personal Computer)Browser in terminal, or other web access requests sides, here are not particularly limited.
When client request accesses http:During //www.a.com, user end to server sends web access requests.
Client is carried out the request sent by web page access and is transmitted to the website belonging to the webpage by server.
When client asks to access http first:During //www.a.com, website returns the response of the webpage Information is to server.
Server is judged in the server without caching in the response message after child resource, the response message is transmitted to Client, then, server starts to analyze in the page<style>Label and<script>Size text in label.If big In equal to CssOutlineMinBytes or JsOutlineMinBytes value, then by corresponding child resource content extraction out, Content to extracting first carries out de-redundancy, then generate in the server corresponding child resource caching (such as xxx.b.css and Xxx.c.js), and record the corresponding relation of this webpage URL and corresponding child resource.
As client requested webpage http again:During //www.a.com, it is sent out that client is carried out web page access by server The request sent is transmitted to the website belonging to the webpage, receives the response message that website returns.Webpage URL of the server according to record The child resource being cached with judging the server in the response message, according to the webpage URL passes corresponding with child resource of record System, learns the form that outside is converted into the respective inner child resource in this response message.Server will be corresponding internal sub Resource is rewritten as the form of outside child resource link, child resource caching (the such as xxx.b.css generated in server before sensing And xxx.c.js).Amended response message is sent to client by server.Client receives revised response message Afterwards, child resource request is sent to server, to obtain corresponding child resource.Server receives the child resource of client transmission please Ask, the inside child resource of caching is searched in the server according to the link in the child resource request, the inside for finding is provided Source returns to client.
When client request accesses http:During //www.d.com, user end to server sends web access requests.
Client is carried out the request sent by web page access and is transmitted to the website belonging to the webpage by server, and website is returned The response message returned is transmitted to the client.
When client asks to access http first:During //www.d.com, website returns the response of the webpage Information is to server.Server does not have to cache the child resource in the response message in judging the server, and server will be responded Information is transmitted to client.After client receives response message, send obtain child resource (such as xxx.e.css and Xxx.f.js request).Server forwards the request to website, receives the child resource that website returns, and the child resource is returned Back to client.
Meanwhile, server starts the size for analyzing each outside CSS child resource and Javascript child resources, when finding certain The size of individual CSS child resources is less than or equal to CssInlineMaxBytes values or finds the size of certain Javascript child resource During less than or equal to JsInlineMaxBytes values, by correspondence child resource content de-redundancy, then by the result cache after de-redundancy In the server, and record the corresponding relation of this webpage URL and child resource.
When client accesses http again:During //www.d.com, client is carried out what web page access was sent by server Request is transmitted to the website belonging to the webpage, receives the response message that website returns.Server is judged according to the webpage URL of record Go out the child resource being cached with the server in the response message, according to the corresponding relation of this webpage URL and child resource of record, The form that internal resource should be converted into corresponding certain child resource in this html page is learnt, is cached before then taking out Child resource (such as xxx.e.css and xxx.f.js), the link of correspondence in the html pages in response message outside child resource is changed The child resource content taken out from caching is written as, and revised response message is returned to into client.
Thus, by above-mentioned technical proposal, solve when the size of outside child resource or internal child resource in webpage is uncomfortable During conjunction, child resource transmission is carried out by the communications link between client and website, cause child resource transmission speed slow, webpage Represent slow-footed problem, achieve raising webpage and represent speed, save the beneficial effect of the communications bandwidth resources of website.
Referring to Fig. 9, the side that the child resource for accessing webpage is loaded in client according to an embodiment of the invention is shown The flow chart of method.Methods described comprises the steps.
Step S910, user end to server send the request for carrying out web page access, and the response that the reception server is returned Information.The response message is the response message that the website belonging to the webpage returns or the server to its amended sound Answer information.
Step S920, client are parsed to response message, according to child resource in the information acquisition webpage for parsing, and Load the child resource.
Algorithm and display be not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein. Various general-purpose systems can also be used together based on teaching in this.As described above, construct required by this kind of system Structure be obvious.Additionally, the present invention is also not for any certain programmed language.It is understood that, it is possible to use it is various Programming language realizes the content of invention described herein, and the description done to language-specific above is to disclose this Bright preferred forms.
In description mentioned herein, a large amount of details are illustrated.It is to be appreciated, however, that the enforcement of the present invention Example can be put into practice in the case where not having these details.In some instances, known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure and help understand one or more in each inventive aspect, exist Above to, in the description of the exemplary embodiment of the present invention, each feature of the present invention is grouped together into single enforcement sometimes In example, figure or descriptions thereof.However, should the method for the disclosure be construed to reflect following intention:I.e. required guarantor The more features of feature is expressly recited in each claim by the application claims ratio of shield.More precisely, such as following Claims it is reflected as, inventive aspect is less than all features of single embodiment disclosed above.Therefore, Thus the claims for following specific embodiment are expressly incorporated in the specific embodiment, wherein each claim itself All as the separate embodiments of the present invention.
Those skilled in the art are appreciated that can be carried out adaptively to the module in the equipment in embodiment Change and they are arranged in one or more different from embodiment equipment.Can be the module or list in embodiment Unit or component are combined into a module or unit or component, and can be divided in addition multiple submodule or subelement or Sub-component.In addition at least some in such feature and/or process or unit is excluded each other, can adopt any Combination is to this specification(Including adjoint claim, summary and accompanying drawing)Disclosed in all features and so disclosed appoint Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification(Including adjoint power Profit requires, makes a summary and accompanying drawing)Disclosed in each feature can be by providing identical, equivalent or the alternative features of similar purpose carry out generation Replace.
Although additionally, it will be appreciated by those of skill in the art that some embodiments described herein include other embodiments In some included features rather than further feature, but the combination of the feature of different embodiments means in of the invention Within the scope of and form different embodiments.For example, in the following claims, embodiment required for protection appoint One of meaning can in any combination mode using.
The present invention all parts embodiment can be realized with hardware, or with one or more processor operation Software module realize, or with combinations thereof realize.It will be understood by those of skill in the art that can use in practice Microprocessor or digital signal processor(DSP)To realize the according to embodiments of the present invention service for processing child resource in webpage The some or all functions of some or all parts in device, client and system.The present invention be also implemented as Perform some or all equipment or program of device of method as described herein(For example, computer program and calculating Machine program product).Such program for realizing the present invention can be stored on a computer-readable medium, or can have one Or the form of multiple signals.Such signal can be downloaded from internet website and be obtained, or provide on carrier signal, Or provided with any other form.
It should be noted that above-described embodiment the present invention will be described rather than limits the invention, and ability Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims, Any reference markss between bracket should not be configured to limitations on claims.Word "comprising" is not excluded the presence of not Element listed in the claims or step.Word "a" or "an" before element does not exclude the presence of multiple such Element.The present invention can come real by means of the hardware for including some different elements and by means of properly programmed computer It is existing.If in the unit claim for listing equipment for drying, several in these devices can be by same hardware branch To embody.The use of word first, second, and third does not indicate that any order.These words can be explained and be run after fame Claim.
The embodiment of the invention discloses in A1, a kind of process webpage child resource method, methods described includes:Server will Client carries out the request sent by web page access and is transmitted to the website belonging to the webpage, receives the response that the website returns Whether information, cached the child resource of the webpage in judging the server;If the uncached net in the server The child resource of page, then server the response message that the website returns is transmitted to into the client, and according in response message The size of the child resource of webpage caches the child resource;If the child resource of the webpage has been cached in the server, take Business device is modified to the response message for receiving according to the child resource for having cached, client is obtained by amended response message Obtain child resource.A2, the method according to A1, wherein, the size caching institute according to the child resource of webpage in response message Stating child resource includes:The server judges whether to cache the sub- money according to the size of the child resource of webpage in response message Source;If it is determined that the caching child resource, then carry out de-redundancy to the child resource, after caching de-redundancy in the server Child resource.A3, the method according to A1 or A2, wherein, the size according to the child resource of webpage in response message is delayed Depositing the child resource includes:The inside child resource of webpage that the server is included in judging the response message that website returns it is big It is little whether to be more than or equal to the first pre-set threshold value, if it is, extract the inside child resource being cached.A4, according to A3 Method, wherein, the child resource that the basis has been cached is modified to the response message for receiving, and makes client by amended Response message obtains child resource to be included:The server by the inside child resource content modification for having cached in response message be with Amended response message is sent to client by the corresponding link of the inside child resource of caching;The server is received The child resource request that client sends, searches inside of caching according to being linked in the server in the child resource request The inside child resource for finding is returned to the client by resource.A5, the method according to A1 or A2, wherein, described The child resource is cached according to the size of the child resource of webpage in response message includes:The server judges the response that website returns Whether the size of the outside child resource of the webpage included in information is less than or equal to the second pre-set threshold value, if it is, it is outer to cache this Portion's child resource.A6, the method according to A5, wherein, the child resource that the basis has been cached is carried out to the response message for receiving Modification, making client obtain child resource by amended response message includes:The server by response message with delay The corresponding link of the outside child resource deposited is revised as the outside child resource content for having cached, and amended response message is sent out Give client.A7, the method according to A1, wherein, the size caching according to the child resource of webpage in response message The child resource includes:The server determines the caching child resource in the size according to the child resource of webpage in response message Afterwards, the URL of the webpage and the corresponding relation of the child resource of caching are recorded.A8, the method according to A7, wherein, it is described According to the child resource for having cached to receive response message modify including:URL of the server according to the webpage of record With the corresponding relation of the child resource of caching, the response message for receiving is changed.A9, the method according to any one of A1-A8, its In, the child resource includes style design table CSS child resources and/or script file child resource.
Embodiments of the invention also disclose B10, a kind of method for loading the child resource for accessing webpage in client, described Method includes:User end to server sends the request for carrying out web page access, and the response message that the reception server is returned, described Response message is the response message that the website belonging to the webpage returns or the server to its amended response message;Visitor Family end is parsed to response message, according to child resource in the information acquisition webpage for parsing, and loads the child resource.
Embodiments of the invention also disclose a kind of server of child resource in C11, process webpage, the server bag Include:Proxy module, cache module and child resource optimization module, the proxy module are suitable to for client to carry out web page access institute The request of transmission is transmitted to the website belonging to the webpage, receives the response message that the website returns, judges the caching mould Whether the child resource of the webpage has been cached in block;The proxy module, is further adapted in judged result is the cache module During the child resource of the uncached webpage, the response message of reception is transmitted to into the client;The child resource optimization module Including:Child resource size analyzes submodule and child resource modification submodule, and the child resource size is analyzed submodule, is suitable to sentencing When disconnected result is the child resource of the uncached webpage in the cache module, according in response message the child resource of webpage it is big It is little that the child resource is cached in the cache module;The child resource changes submodule, and it is described slow to be suitable in judged result When the child resource of the webpage has been cached in storing module, the response message for receiving is modified according to the child resource for having cached, Client is made to obtain child resource by amended response message;The proxy module, it is described slow to be further adapted in judged result When the child resource of the webpage has been cached in storing module, child resource modification submodule amended response message is sent to The client;The cache module, is suitable to the child resource included by cache web pages.C12, the server according to C11, its In, the child resource optimization module also includes de-redundancy submodule, and the de-redundancy submodule is suitable to it is determined that caching After resource, de-redundancy is carried out to the child resource, the child resource after de-redundancy is cached in the cache module.C13, basis Server described in C11 or C12, wherein, the child resource size analyzes submodule, is suitable to judge the response message that website returns In the size of the inside child resource of webpage that includes whether more than or equal to the first pre-set threshold value, if it is, it is sub to extract inside Resource is cached in the cache module.C14, the server according to C13, wherein, the child resource changes submodule Block, it is corresponding with the inside child resource of caching to be suitable to the inside child resource content modification for having cached in response message Link;The proxy module, is suitable to for amended response message to be sent to client, and the child resource for receiving client transmission please Ask, according to the inside child resource that being linked in the cache module in the child resource request searches caching, in finding Portion's child resource returns to the client.C15, the server according to C11 or C12, wherein, the child resource size analysis Whether submodule, the size of the outside child resource of the webpage included in being suitable to judge the response message that website returns are less than or equal to the Two pre-set threshold values, if it is, the outside child resource is cached in the cache module.C16, the server according to C15, Wherein, the child resource changes submodule, is suitable to repair with corresponding the linking of outside child resource for caching in response message It is changed to the outside child resource content for having cached;The proxy module, is suitable to for amended response message to be sent to client. C17, the server according to C11, wherein, the child resource size analyzes submodule, is suitable to according to net in response message After the size of the child resource of page determines the caching child resource, the URL for recording the webpage is corresponding with the child resource of caching Relation.C18, the server according to C17, wherein, the child resource changes submodule, is suitable to according to the webpage for recording URL and the corresponding relation of the child resource of caching, change the response message for receiving.C19, according to any one of C11-C18 Server, wherein, the child resource includes style design table CSS child resources and/or script file child resource.
Embodiments of the invention also disclose the client that D20, a kind of loading access the child resource of webpage, the client Including:Communication module, is suitable to server send the request for carrying out web page access, and the response message that the reception server is returned, The response message is the response message that the website belonging to the webpage returns or the server to its amended response letter Breath;Parsing module, is suitable to parse response message, according to child resource in the information acquisition webpage for parsing;Load-on module, It is suitable to load the child resource for obtaining.
Embodiments of the invention also disclose the system that E21, a kind of loading access the child resource of webpage, the system bag Include:Server as described in any one of C11 to C19, and the client as described in D20.

Claims (17)

1. a kind of method for processing child resource in webpage, methods described includes:
Client is carried out the request sent by web page access and is transmitted to the website belonging to the webpage by server, receives the net Stand return response message, the child resource of the webpage whether has been cached in judging the server;
If the child resource of the uncached webpage in the server, the response message that the website is returned by server turns Issue the client, and analyze the size of webpage child resource in response message, according to the child resource of webpage in response message Size caches the child resource;
If the child resource of the webpage has been cached in the server, server is according to the child resource for having cached to reception Response message is modified, and makes client obtain child resource by amended response message;
The size according to the child resource of webpage in response message caches the child resource to be included:
The size of the inside child resource of webpage that the server is included in judging the response message that website returns whether more than etc. In the first pre-set threshold value, if it is, extract the inside child resource cached,
Or,
Whether the size of the outside child resource of webpage that the server is included in judging the response message that website returns is less than etc. In the second pre-set threshold value, if it is, caching the outside child resource.
2. method according to claim 1, wherein,
The size according to the child resource of webpage in response message caches the child resource to be included:
The server judges whether to cache the child resource according to the size of the child resource of webpage in response message;
If it is determined that the caching child resource, then carry out de-redundancy to the child resource, cache de-redundancy in the server Child resource afterwards.
3. method according to claim 1, wherein,
The child resource that the basis has been cached is modified to the response message for receiving, and makes client by amended response letter Breath obtains child resource to be included:
The server by the inside child resource content modification for having cached in response message be and caching the inside child resource Amended response message is sent to client by corresponding link;
The server receives the child resource request that client sends, according to being linked at the server in child resource request The inside child resource for finding is returned to the client by the middle inside child resource for searching caching.
4. method according to claim 1, wherein,
The child resource that the basis has been cached is modified to the response message for receiving, and makes client by amended response letter Breath obtains child resource to be included:
The server by be revised as having cached in response message with corresponding the linking of outside child resource for caching this is outer Amended response message is sent to client by portion's child resource content.
5. method according to claim 1, wherein, the size caching institute according to the child resource of webpage in response message Stating child resource includes:The server determines the caching child resource in the size according to the child resource of webpage in response message Afterwards, the URL of the webpage and the corresponding relation of the child resource of caching are recorded.
6. method according to claim 5, wherein, the child resource that the basis has been cached is carried out to the response message for receiving Modification includes:URL of the server according to the webpage of record and the corresponding relation of the child resource of caching, change the sound for receiving Answer information.
7. method according to claim 1, wherein, the child resource includes style design table CSS child resources and/or script File child resource.
8. a kind of method for loading the child resource for accessing webpage in client, methods described includes:
User end to server sends the request for carrying out web page access, and the response message that the reception server is returned, the response Information is the response message that the website belonging to the webpage returns or the server webpage in the response message is analyzed After the size of child resource, when the size of the inside child resource of the webpage included in response message is more than or equal to the first pre-set threshold value Extract the inside child resource to be cached, or the size of the outside child resource of the webpage included in response message is less than or equal to the The outside child resource is cached during two pre-set threshold values, according to the child resource for having cached to its amended response message;
Client is parsed to response message, according to child resource in the information acquisition webpage for parsing, and loads the child resource.
9. a kind of server for processing child resource in webpage, the server includes:Proxy module, cache module and child resource are excellent Change module,
The proxy module, is suitable to for client to carry out the request sent by web page access be transmitted to the net belonging to the webpage Stand, receive the response message that the website returns, in judging the cache module, whether cached the child resource of the webpage;
The proxy module, when being further adapted for the child resource of the uncached webpage in judged result is the cache module, will The response message of reception is transmitted to the client;
The child resource optimization module includes:Child resource size analyzes submodule and child resource modification submodule,
The child resource size analyzes submodule, is suitable to the son of the uncached webpage in judged result is the cache module During resource, the size of webpage child resource in response message is analyzed, according to the size of the child resource of webpage in response message described The child resource is cached in cache module;
The child resource changes submodule, is suitable to the child resource of the webpage has been cached in judged result is the cache module When, the response message for receiving is modified according to the child resource for having cached, client is obtained by amended response message Obtain child resource;
The proxy module, when being further adapted for having cached the child resource of the webpage in judged result is the cache module, will The child resource is changed the amended response message of submodule and is sent to the client;
The cache module, is suitable to the child resource included by cache web pages;
The child resource size analyzes submodule, the inside son money of the webpage included in being suitable to the response message for judge website return Whether the size in source is more than or equal to the first pre-set threshold value, if it is, extract the inside child resource entering in the cache module Row caching;Or,
Whether the size of the outside child resource of the webpage included in being suitable to the response message for judge website return is less than or equal to second Pre-set threshold value, if it is, the outside child resource is cached in the cache module.
10. server according to claim 9, wherein, the child resource optimization module also includes de-redundancy submodule, institute De-redundancy submodule is stated, and is suitable to it is determined that after the caching child resource, de-redundancy is carried out to the child resource, in the caching mould The child resource after de-redundancy is cached in block.
11. servers according to claim 9, wherein, the child resource changes submodule, is suitable in response message The inside child resource content modification for having cached is links corresponding with the inside child resource of caching;The proxy module, fits In amended response message is sent to client, the child resource request that client sends is received, is asked according to the child resource In be linked at the cache module in search the inside child resource of caching, the inside child resource for finding is returned to into the visitor Family end.
12. servers according to claim 9, wherein, the child resource changes submodule, be suitable to by response message with The corresponding link of the outside child resource that cached is revised as the outside child resource content for having cached;The proxy module, fits In amended response message is sent to client.
13. servers according to claim 9, wherein, the child resource size analyzes submodule, is suitable to according to response After the size of the child resource of webpage determines the caching child resource in information, the URL of the webpage and the sub- money of caching are recorded The corresponding relation in source.
14. servers according to claim 13, wherein, the child resource changes submodule, is suitable to the net according to record The URL of page and the corresponding relation of the child resource of caching, change the response message for receiving.
15. servers according to claim 9, wherein, the child resource include style design table CSS child resources and/or Script file child resource.
A kind of 16. loadings access the client of the child resource of webpage, and the client includes:
Communication module, is suitable to server send the request for carrying out web page access, and the response message that the reception server is returned, institute It is response message or the server that website belonging to the webpage returns in the response message is analyzed to state response message After the size of the child resource of webpage, when the size of the inside child resource of the webpage included in response message is preset more than or equal to first Extract the inside child resource to be cached during threshold values, or the size of the outside child resource of the webpage included in response message is less than The outside child resource is cached during equal to the second pre-set threshold value, according to the child resource for having cached to its amended response message;Solution Analysis module, is suitable to parse response message, according to child resource in the information acquisition webpage for parsing;
Load-on module, is suitable to load the child resource for obtaining.
The system that a kind of 17. loadings access the child resource of webpage, the system include:
Server as any one of claim 9-15, and
Client as claimed in claim 16.
CN201310214937.4A 2013-05-31 2013-05-31 Method, server, client side and system for processing child resources in web page Active CN103281387B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310214937.4A CN103281387B (en) 2013-05-31 2013-05-31 Method, server, client side and system for processing child resources in web page

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310214937.4A CN103281387B (en) 2013-05-31 2013-05-31 Method, server, client side and system for processing child resources in web page

Publications (2)

Publication Number Publication Date
CN103281387A CN103281387A (en) 2013-09-04
CN103281387B true CN103281387B (en) 2017-04-12

Family

ID=49063832

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310214937.4A Active CN103281387B (en) 2013-05-31 2013-05-31 Method, server, client side and system for processing child resources in web page

Country Status (1)

Country Link
CN (1) CN103281387B (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9330074B2 (en) * 2013-10-31 2016-05-03 Google Inc. Style sheet speculative preloading
CN104468740B (en) * 2014-11-21 2019-03-08 网宿科技股份有限公司 A kind of webpage transmission intelligent processing system and its method
CN105760396B (en) * 2014-12-17 2019-10-25 广州市动景计算机科技有限公司 A kind of webpage loading method and device
CN104615771B (en) * 2015-02-13 2018-12-21 广州华多网络科技有限公司 A kind of method and device obtaining web data
CN105100099A (en) * 2015-07-29 2015-11-25 北京京东尚科信息技术有限公司 Intelligent watch and website access request processing method thereon
WO2017077847A1 (en) * 2015-11-02 2017-05-11 日本電信電話株式会社 Analysis device, analysis method, and analysis program
CN106066868B (en) * 2016-05-27 2019-12-03 北京小米移动软件有限公司 Webpage loading method and device
CN106161427B (en) * 2016-06-08 2020-02-11 北京兰云科技有限公司 Webpage processing method, network analyzer and HTTP server
CN106294844A (en) * 2016-08-19 2017-01-04 乐视控股(北京)有限公司 Browsing device net page loading processing method and device
CN112968939B (en) * 2017-01-05 2023-12-05 创新先进技术有限公司 Mobile terminal resource loading method and device
CN108600342B (en) * 2018-03-30 2020-01-10 连尚(新昌)网络科技有限公司 Message display method, device and storage medium
CN109299414A (en) * 2018-09-26 2019-02-01 深圳壹账通智能科技有限公司 A kind of method and terminal of loading page
CN109670131A (en) * 2018-12-18 2019-04-23 网宿科技股份有限公司 The processing of Resource Description File, the acquisition methods of page resource and intermediate server

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101539932A (en) * 2009-01-21 2009-09-23 北京跳网无限科技发展有限公司 Synchronization access technology of transforming web page
CN102456035A (en) * 2010-10-28 2012-05-16 金蝶软件(中国)有限公司 Webpage resource cache control method, device and system
CN102710748A (en) * 2012-05-02 2012-10-03 华为技术有限公司 Data acquisition method, system and equipment
CN102981705A (en) * 2012-11-09 2013-03-20 北京奇虎科技有限公司 Server-side browser implementing method and server

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1427143A1 (en) * 2001-09-14 2004-06-09 Sony Corporation Network information processing system and network information processing method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101539932A (en) * 2009-01-21 2009-09-23 北京跳网无限科技发展有限公司 Synchronization access technology of transforming web page
CN102456035A (en) * 2010-10-28 2012-05-16 金蝶软件(中国)有限公司 Webpage resource cache control method, device and system
CN102710748A (en) * 2012-05-02 2012-10-03 华为技术有限公司 Data acquisition method, system and equipment
CN102981705A (en) * 2012-11-09 2013-03-20 北京奇虎科技有限公司 Server-side browser implementing method and server

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
网站前端技术及其对网站性能的影响研究;韩涛;《中小企业管理与科技》;20121031(第10期);第291-292页第3.3.4节 *

Also Published As

Publication number Publication date
CN103281387A (en) 2013-09-04

Similar Documents

Publication Publication Date Title
CN103281387B (en) Method, server, client side and system for processing child resources in web page
US11256775B1 (en) Progressive prefetching
CA2640025C (en) Methods and devices for post processing rendered web pages and handling requests of post processed web pages
KR101824222B1 (en) Fast rendering of websites containing dynamic content and stale content
US20180302492A1 (en) Key resource prefetching using front-end optimization (FEO) configuration
US9407717B1 (en) Selective prefetch scanning
CN102438045B (en) Method and system for pre-fetching web page, and method for accessing web page
US9015348B2 (en) Dynamically selecting between acceleration techniques based on content request attributes
US9684636B2 (en) Ad blocking page display method and device
US11102325B2 (en) Configurable and dynamic transformation of web content
US8533310B2 (en) Method and apparatus for acceleration by prefetching associated objects
US10496725B2 (en) Computer networking system and method with pre-fetching using browser specifics and cookie information
US8255491B1 (en) Determining a particular type of wireless device to be emulated
US9690568B2 (en) Client-side script bundle management system
CN102075570B (en) Method for implementing HTTP (hyper text transport protocol) message caching mechanism based on keywords
JP6203374B2 (en) Web page style address integration
CN103455478A (en) Webpage access accelerating method and device
CN106294379A (en) The loading method of a kind of page, device and system
CN103258056B (en) Process the method for style design table, server, client and system
CN104615771B (en) A kind of method and device obtaining web data
CN103269377A (en) Script file processing method, server, client and system
CN103312736B (en) Web page processing method and system and proxy server
CN107436940B (en) Method for dynamically displaying data at web front end based on user information behavior analysis
US11716405B1 (en) System and method for identifying cache miss in backend application
KR20120016335A (en) Web page pre-caching system and method for offline-executing

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
TR01 Transfer of patent right

Effective date of registration: 20220728

Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015

Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Patentee before: Qizhi software (Beijing) Co.,Ltd.

TR01 Transfer of patent right