CN111079055A - Method for loading webpage - Google Patents
Method for loading webpage Download PDFInfo
- Publication number
- CN111079055A CN111079055A CN201911409232.1A CN201911409232A CN111079055A CN 111079055 A CN111079055 A CN 111079055A CN 201911409232 A CN201911409232 A CN 201911409232A CN 111079055 A CN111079055 A CN 111079055A
- Authority
- CN
- China
- Prior art keywords
- content
- key
- browser
- webpage
- server
- 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.)
- Withdrawn
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9574—Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/0703—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
- G06F11/0793—Remedial or corrective actions
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Quality & Reliability (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention relates to a method for loading a webpage, which divides webpage content into key content and non-key content, and when a browser downloads the non-key content, if the downloading fails, the browser can inquire a substitution strategy from a webpage server, thereby improving the webpage loading speed and avoiding certain loading failure conditions.
Description
Technical Field
The invention belongs to the field of computers, and particularly relates to a method for loading a webpage.
Background
When a user accesses the internet, the user generally inputs a website to be accessed by using a browser of a client, the client queries and connects to a corresponding web server according to the website, the web server returns a corresponding web page (typically, a web page in html format, for example), and then the browser parses and loads the content of the web page.
As the design of the web page becomes more and more complex, the content in the web page becomes more and more, and in many cases, the web page carries the content pointing to other servers, so when the browser loads the web page, it needs to download the content to the other servers. For example, a web page may need to have a picture loaded, which is not on the original web page server a, but on another server B, i.e. the URL of the web page points to server B. At this point the browser needs to access server B to download the picture. However, if server B has a problem at this time, the loading and displaying speed of the web page is severely slowed down, and the web page loading may even fail.
Disclosure of Invention
In order to solve the above problems in the prior art, the present invention provides a method for loading a web page.
The technical scheme adopted by the invention is as follows:
a method of loading a web page, comprising the steps of:
step 100: content needing to be downloaded from a content server in a webpage is divided into key content and non-key content, and the key content and the non-key content are noted in the webpage;
step 200: the client browser acquires the webpage from a webpage server, analyzes the webpage and determines key content and non-key content in the webpage;
step 300: the browser tries to download the key contents, if one or more key contents are failed to download, the browser fails to load the webpage, and the method is ended;
step 400: the browser tries to download the non-key content, and for the non-key content with failed download, the browser sends a substitution request to the webpage server;
step 500: after receiving the substitution request, the webpage server returns a substitution mode and/or substitution content of corresponding non-key content to the browser according to a preset substitution strategy;
step 600: the browser loads and displays the web page based on all successfully downloaded critical content, all successfully downloaded non-critical content, the alternative ways and/or alternative content for the non-critical content determined in accordance with step 500.
Further, after step 600, further comprising:
step 700: and the browser continuously tries to download the non-key contents which are failed to download in the background, and if some non-key contents are successfully downloaded, the browser rejoins the non-key contents into the webpage display.
Further, still include:
step 800: the web server monitors all the substitute requests, and if the number of times that a certain content server or URL is provided with substitute requests within a preset time exceeds a threshold value, the web server gives an alarm.
Further, html tag attributes are used to note key content in the web page.
Further, key content is noted in the web page using specialized tags.
Further, in step 300, the browser attempts to connect to one or more content servers simultaneously while downloading the key content.
Further, in step 300, the browser downloads the key content in order according to a predetermined rule.
Further, the alternative policy is determined during a web page design phase and then stored in the web page server for browser query.
Further, the replacement policy includes: the corresponding non-critical content is ignored.
Further, the replacement policy includes: content on the web server is used instead of non-critical content.
The invention has the beneficial effects that: the webpage loading speed is increased, some loading failures are avoided, and website managers can be helped to find possible problems.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, and are not to be considered limiting of the invention, in which:
FIG. 1 is a diagram of a system architecture supporting web browsing.
Detailed Description
The present invention will now be described in detail with reference to the drawings and specific embodiments, wherein the exemplary embodiments and descriptions are provided only for the purpose of illustrating the present invention and are not to be construed as limiting the present invention.
Referring to FIG. 1, a diagram of a system architecture supporting web browsing is shown. The whole system comprises a client, a webpage server and one or more content servers.
The client typically includes a browser, and the user loads and browses a web page of a specified website using the browser. For example, when the user inputs the web address www.abc.com in the browser address bar, the browser determines the web server corresponding to the web address through address resolution, and then requests the corresponding web page from the web server.
Html, the web server will store the main page named index.
After the browser obtains the webpage, the browser can analyze the webpage content, and load and display the webpage. Other URLs may be included in the web page to point to other content servers. Html, for example, includes a picture whose URL is www.def.com/picture. Therefore, the browser needs to parse www.def.com, determine the content server it points to, request and obtain the picture. The content server is thus used for storing parts of the web content, such as pictures, videos, even further html or js files, etc.
Based on the above system structure, the specific steps of loading web pages in the present invention are described in detail as follows:
step 100: the content of the web page to be downloaded from the content server is distinguished into key content and non-key content and noted in the web page.
Step 100 is a step that needs to be completed in the web page design stage, and the contents are classified in the web page design. The content is the content that the browser needs to download from other content servers (not the web server itself).
Specifically, the key content refers to content necessary for loading and displaying a web page, and if the key content is not available, the loading or displaying of the web page cannot be completed or the web page is not displayed meaningfully. While non-critical content refers to content that is not necessary for loading and displaying a web page, which may be ignored by whiteout or simply replaced.
For example, for a video news web page, the video in which is important and indispensable for the web page can be determined as the key content; meanwhile, the webpage has some advertisement pictures which are not important and can be lacked, and the advertisement pictures are determined as non-key content.
In a specific implementation, an attribute may be added to an html tag of the key content to indicate that the content included in the tag is the key content, and a tag without the attribute defaults to non-key content. Alternatively, special tags may be used to designate key content. Of course, those skilled in the art may use other methods to note in the web page, and the present invention is not limited thereto.
Step 200: and the client browser acquires the webpage from the webpage server, analyzes the webpage and determines the key content and the non-key content in the webpage.
The steps of the browser acquiring the web page are described above, which are already in the prior art, and are not described herein again. In short, the browser can determine which contents need to be downloaded from the content server, which contents are key contents and which contents are non-key contents during the process of parsing the web page according to the predetermined web page annotation rule.
Step 300: and the browser tries to download the key contents, if one or more key contents are failed to download, the browser fails to load the displayed webpage, and the method is ended.
In particular, the web page may have one or more key contents that need to be downloaded from one or more content servers. The browser may attempt to connect to the one or more content servers simultaneously while downloading the key content. Of course, the browser may download the key content in order according to a predetermined rule, which is not limited by the present invention.
Downloading the key content may fail under various conditions, such as that the corresponding content server fails to connect, or that the key content fails to be completely downloaded within a predetermined time or a predetermined number of attempts, or that the content server reports that the key content does not exist, etc. In short, if there is a failure in downloading the key content, the importance of the key content to the web page indicates that the loading of the web page has failed, and the browser directly reports the failure to the user and does not attempt to load other content. If all the key contents are successfully downloaded, at least the main part of the webpage is indicated to be free of problems, the main part can be successfully loaded and displayed, and the subsequent steps can be continuously executed.
Step 400: the browser attempts to download the non-critical content, and for non-critical content that fails to download, the browser sends a substitute request to the web server.
Similar to the key content, the downloading of the non-key content may be successful or may also fail, and the failure condition is the same as the key content, which is not described herein again.
The browser determines which non-critical content failed to download, and sends a replacement request to the web server, where the replacement request indicates which non-critical content needs to be replaced (i.e., the non-critical content that failed to download). For example, the URL of the non-critical content that failed to download may be indicated in the substitute request.
The purpose of the substitute request is to query the web server for how to process if the non-critical content cannot be obtained.
Step 500: and after receiving the substitution request, the webpage server returns a substitution mode and/or substitution content of corresponding non-key content to the browser according to a preset substitution strategy.
The replacement policy is determined during the web page design phase and then stored in the web page server for browser queries.
According to a specific embodiment of the invention, one of the simplest alternative strategies is to ignore the corresponding non-critical content. For example, if a piece of non-key content that fails to be downloaded is an advertisement picture, the web server returns an alternative way to ignore the advertisement picture, so the browser directly ignores the advertisement picture when loading the web page, and does not load and display the advertisement picture.
According to another embodiment of the invention, an alternative policy is to use content on the web server instead of non-critical content. For example, if a piece of non-key content which fails to be downloaded is an advertisement picture, the web page server may return a preset default advertisement picture, so that the browser uses the default advertisement picture to replace the advertisement picture which needs to be downloaded originally when loading the web page.
The above are examples of two alternative strategies proposed by the present invention, and those skilled in the art may set different alternative strategies according to specific situations and needs, and the present invention is not limited thereto. A
Step 600: the browser loads and displays the web page based on all successfully downloaded critical content, all successfully downloaded non-critical content, the alternative ways and/or alternative content for the non-critical content determined in accordance with step 500.
All content that needs to be retrieved from the content server is retrieved, or successfully downloaded, or alternative and/or alternate content is determined, and the browser can complete the loading and display of the web page, step 600.
The method avoids the situation that the webpage loading speed is slow or the webpage loading fails due to the fact that some non-key contents cannot be downloaded, and the webpage can be loaded normally under the condition that the main body part of the webpage is available through the division of the key contents.
If some non-key contents are replaced due to failure in downloading, the web page displayed in step 600 is different from the originally designed web page, and in order to better ensure the web page effect, the present invention may further include:
step 700: and the browser continuously tries to download the non-key contents which are failed to download in the background, and if some non-key contents are successfully downloaded, the browser rejoins the non-key contents into the webpage display.
For example, after step 600 is performed, the browser has actually loaded and displayed the web page, but one of the advertisement pictures was replaced by the aforementioned default advertisement picture, the browser may continue to attempt to download the advertisement picture one or more times in the background, and if the download is successful, replace the default advertisement picture in the web page with the advertisement picture.
Step 800: the web server monitors all the substitute requests, and if the number of times that a certain content server or URL is provided with substitute requests within a preset time exceeds a threshold value, the web server gives an alarm.
For example, if the substitution request during a day relates multiple times to content stored by a certain content server, and the number of times exceeds a predetermined threshold. It is indicated that the content server is likely to have a serious problem and is no longer suitable for storing content. The web server therefore issues alerts to the administrator of the web site to perform an inspection or to modify the web design. Therefore, website management personnel can find problems possibly occurring in the website in time, and website management is facilitated.
The above description is only a preferred embodiment of the present invention, and all equivalent changes or modifications of the structure, characteristics and principles described in the present invention are included in the scope of the present invention.
Claims (10)
1. A method for loading a web page, comprising the steps of:
step 100: content needing to be downloaded from a content server in a webpage is divided into key content and non-key content, and the key content and the non-key content are noted in the webpage;
step 200: the client browser acquires the webpage from a webpage server, analyzes the webpage and determines key content and non-key content in the webpage;
step 300: the browser tries to download the key contents, if one or more key contents are failed to download, the browser fails to load the webpage, and the method is ended;
step 400: the browser tries to download the non-key content, and for the non-key content with failed download, the browser sends a substitution request to the webpage server;
step 500: after receiving the substitution request, the webpage server returns a substitution mode and/or substitution content of corresponding non-key content to the browser according to a preset substitution strategy;
step 600: the browser loads and displays the web page based on all successfully downloaded critical content, all successfully downloaded non-critical content, the alternative ways and/or alternative content for the non-critical content determined in accordance with step 500.
2. The method of claim 1, after step 600, further comprising:
step 700: and the browser continuously tries to download the non-key contents which are failed to download in the background, and if some non-key contents are successfully downloaded, the browser rejoins the non-key contents into the webpage display.
3. The method of any one of claims 1-2, further comprising:
step 800: the web server monitors all the substitute requests, and if the number of times that a certain content server or URL is provided with substitute requests within a preset time exceeds a threshold value, the web server gives an alarm.
4. The method of any of claims 1-3, wherein html tag attributes are used to note key content in a web page.
5. A method according to any of claims 1-3, characterized in that key content is annotated in the web page using special tags.
6. The method according to any of claims 1-5, wherein in step 300, the browser attempts to connect to one or more content servers simultaneously while downloading the key content.
7. The method according to any one of claims 1-5, wherein in step 300, the browser downloads the key contents in sequence according to a predetermined rule.
8. The method of claim 1, wherein the alternative policy is determined during a web page design phase and then stored in the web page server for browser query.
9. The method of claim 8, wherein the replacement policy comprises: the corresponding non-critical content is ignored.
10. The method of claim 8, wherein the replacement policy comprises: content on the web server is used instead of non-critical content.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911409232.1A CN111079055A (en) | 2019-12-31 | 2019-12-31 | Method for loading webpage |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911409232.1A CN111079055A (en) | 2019-12-31 | 2019-12-31 | Method for loading webpage |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111079055A true CN111079055A (en) | 2020-04-28 |
Family
ID=70320536
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911409232.1A Withdrawn CN111079055A (en) | 2019-12-31 | 2019-12-31 | Method for loading webpage |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111079055A (en) |
-
2019
- 2019-12-31 CN CN201911409232.1A patent/CN111079055A/en not_active Withdrawn
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7069497B1 (en) | System and method for applying a partial page change | |
US9749198B2 (en) | Methods and systems for monitoring computer systems using wireless devices | |
US8732571B2 (en) | Methods and systems for generating and displaying a preview image of a content area | |
CN110647700A (en) | Page resource loading method and device, computer equipment and storage medium | |
US8527862B2 (en) | Methods for making ajax web applications bookmarkable and crawlable and devices thereof | |
CN104077310B (en) | Load the method, apparatus and system of resource file | |
US10528651B2 (en) | Client-side aggregation of web content | |
CN105743945B (en) | Document down loading method and system based on switching loading source | |
CN100385444C (en) | Method for providing sitemap viewer for use with web browser | |
WO2015062416A1 (en) | Method and device for loading webpages based onuiwebview components | |
WO2010094927A1 (en) | Content access platform and methods and apparatus providing access to internet content for heterogeneous devices | |
CN109634753B (en) | Data processing method, device, terminal and storage medium for switching browser kernels | |
CN103699674A (en) | Webpage storing method, webpage opening method, webpage storing device, webpage opening device and webpage browsing system | |
US7698256B1 (en) | History support for stateless Javascript Web client | |
CN108256014B (en) | Page display method and device | |
US20080172396A1 (en) | Retrieving Dated Content From A Website | |
CN102890687B (en) | A kind of mthods, systems and devices browsing webpage picture group | |
CN105528369A (en) | Webpage transcoding method and device and server | |
US9147006B2 (en) | Requesting computer data assets | |
US10095791B2 (en) | Information search method and apparatus | |
CN111079055A (en) | Method for loading webpage | |
CN111984868A (en) | Method and device for controlling webpage browsing in browser | |
CN117112940A (en) | Offline data display method and device, electronic equipment and readable storage medium | |
CN107451182B (en) | File caching method based on Appcache | |
JP6358049B2 (en) | Local storage synchronization method, local storage synchronization apparatus, and local storage synchronization program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20200428 |
|
WW01 | Invention patent application withdrawn after publication |