CN112214702A - Method for improving webpage presentation speed - Google Patents
Method for improving webpage presentation speed Download PDFInfo
- Publication number
- CN112214702A CN112214702A CN202011120668.1A CN202011120668A CN112214702A CN 112214702 A CN112214702 A CN 112214702A CN 202011120668 A CN202011120668 A CN 202011120668A CN 112214702 A CN112214702 A CN 112214702A
- Authority
- CN
- China
- Prior art keywords
- files
- snapshot
- common
- webpage
- file
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 16
- 238000009877 rendering Methods 0.000 claims description 2
- 238000007781 pre-processing Methods 0.000 abstract description 4
- 238000010586 diagram Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- VYZAMTAEIAYCRO-UHFFFAOYSA-N Chromium Chemical compound [Cr] VYZAMTAEIAYCRO-UHFFFAOYSA-N 0.000 description 1
- 229910052804 chromium Inorganic materials 0.000 description 1
- 239000011651 chromium Substances 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a method for improving the webpage presenting speed, which comprises the steps of converting common files into snapshot files of a browser kernel, storing the snapshot files in a local machine of a user, reading the snapshot files corresponding to the local user when detecting that the common files need to be used, loading the snapshot files into the browser, adding special marks on the common files or frames in a webpage to generate the snapshot files locally through the browser kernel without generating and downloading through a server. According to the method and the device, the objective rule that the common file exists on part of front-end pages is utilized, the common file is converted into the locally preprocessed snapshot file to be used in the subsequent web pages, the network loading and preprocessing processes are omitted, and the web page presenting speed is improved.
Description
Technical Field
The invention relates to an information technology, in particular to a method for improving the webpage presenting speed.
Background
At present, most front-end pages have a fixed rule in composition, and part of the front-end pages are common files which need to be changed rarely, such as frame files or tool files; the other part is a non-common file such as a business file which needs to be frequently changed. Most web pages use common documents that are consistent across companies. For the current industry, the front-end framework used by most web pages is also relatively fixed (the current front-end development mainstream framework is three frameworks, Angular/fact/Vue). However, in actual use, even if there are so many common files, they still need to be reloaded or preprocessed by the browser (such as compiling), which takes much time.
Disclosure of Invention
The invention provides a method for improving the webpage presenting speed, which aims to overcome the defects of the prior art and converts common files into locally preprocessed snapshot files by utilizing the objective rule that common files exist on partial front-end pages; once the fact that the common files need to be used by the webpage is detected, the snapshots of the files are directly used for replacing, the processes of network loading and preprocessing of the common files are omitted, the webpage can be directly used, and the webpage presenting speed is improved.
In order to solve the technical problems, the invention provides the following technical scheme:
the invention provides a method for improving the webpage presentation speed, which comprises the steps of converting common files into snapshot files of a browser kernel, storing the snapshot files in a local machine of a user, reading out the snapshot files corresponding to the local machine of the user when detecting that a webpage needs to use the common files, and loading the snapshot files into a browser.
As a preferred technical scheme of the invention, the snapshot file can be identified by a browser by adding a special identifier to a public file or a frame file in a webpage to generate a snapshot for subsequent use without being generated and downloaded by a server.
Compared with the prior art, the invention has the following beneficial effects:
the invention utilizes the objective rule that the common file exists on part of front-end pages to convert the common file into a snapshot file which is preprocessed locally; once the common files are detected to be referred in the webpage, the snapshots of the files are directly used, so that the processes of network loading and preprocessing of the common files are omitted, and the webpage presenting speed is improved.
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 specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
FIG. 1 is a schematic diagram of a prior art scheme;
FIG. 2 is a prior art scenario activity flow diagram;
FIG. 3 is a schematic of the present invention;
FIG. 4 is an activity flow diagram of the present invention.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
Example 1
As shown in fig. 1-4, the present invention provides a method for increasing a web page rendering speed, which converts common files into snapshot files of a browser kernel, stores the snapshot files in a local machine of a user, and reads out the snapshot files corresponding to the local machine of the user and loads the snapshot files into a browser when detecting that the common files need to be used.
The snapshot file can be generated locally after being identified by a browser kernel by adding a special identifier to a public file or a frame in a webpage, and is not required to be generated and downloaded through a server.
Assume a common file example address is:
https://h5.bestpay.com.cn/subapps/hybridJsDemo/hybridJsDemo3.0/static/js/vendor.3f2da830ff974a680a07.js
the implementation steps are as follows:
1. firstly, a makesnapshot tool provided by a Javascript interpretation engine (v 8) in Chromium is properly modified, and a corresponding Javascript snapshot file, such as a snapshot, is generated from a common file;
2. the snapshot file is placed in a local storage, and the storage path is as follows:
/data/data/com.bestpay_webview.export.webview.shell/app_bestpaywebviewcore/snapshot/snapshot.bin;
3. in the process of loading the web page, once the browser kernel finds that the web page loads the common file, the browser kernel transfers to load the snapshot file corresponding to the local path, and then calls an interface of a v8 engine to use the snapshot file.
Example code:
script=v8::ScriptCompiler::CompileUnboundScript(isolate, &source,v8::ScriptCompiler::kConsumeCodeCache).ToLocalChecked();
wherein variable & source represents the binary stream of the snapshot file;
the script is then executed
script->BindToCurrentContext()->Run(local_frame->MainWorldScriptContext();
And completing the analysis execution flow of the snapshot.
The steps replace the original steps of downloading and analyzing the Javascript file through the network, and the time of resource downloading and Javascript analysis is saved.
4. The browser engine continues to perform subsequent other processes to render the web page.
Compared with the prior art, the invention has the following beneficial effects:
the invention utilizes the objective rule that the common file exists on part of front-end pages to convert the common file into a snapshot file which is preprocessed locally; once the common files are detected to be referred in the webpage, the snapshots of the files are directly used, so that the processes of network loading and preprocessing of the common files are omitted, and the webpage presenting speed is improved.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that changes may be made in the embodiments and/or equivalents thereof without departing from the spirit and scope of the invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (2)
1. A method for improving the presentation speed of a webpage is characterized in that common files are converted into snapshot files used by a browser kernel and stored in a local machine of a user, and when the webpage detects that the common files need to be used, the snapshot files corresponding to the local machine of the user are read out and loaded into the browser.
2. The method for increasing the webpage rendering speed as claimed in claim 1, wherein the snapshot file can be generated locally via a browser kernel by adding a special identifier to a public file in the webpage without being generated and downloaded through a server.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011120668.1A CN112214702A (en) | 2020-10-19 | 2020-10-19 | Method for improving webpage presentation speed |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011120668.1A CN112214702A (en) | 2020-10-19 | 2020-10-19 | Method for improving webpage presentation speed |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112214702A true CN112214702A (en) | 2021-01-12 |
Family
ID=74055891
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011120668.1A Pending CN112214702A (en) | 2020-10-19 | 2020-10-19 | Method for improving webpage presentation speed |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112214702A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113885967A (en) * | 2021-10-22 | 2022-01-04 | 北京字跳网络技术有限公司 | Method, device, equipment and medium for starting small program |
-
2020
- 2020-10-19 CN CN202011120668.1A patent/CN112214702A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113885967A (en) * | 2021-10-22 | 2022-01-04 | 北京字跳网络技术有限公司 | Method, device, equipment and medium for starting small program |
CN113885967B (en) * | 2021-10-22 | 2024-02-13 | 北京字跳网络技术有限公司 | Method, device, equipment and medium for starting applet |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20170192880A1 (en) | Defect prediction | |
CN111381825B (en) | Method and device for generating small program | |
US20070198705A1 (en) | System and method for integrating resources in a network | |
CN106708704B (en) | Method and device for classifying crash logs | |
US20150269052A1 (en) | Method and apparatus for supporting performance analysis | |
CN107169000B (en) | Static resource dissemination method and device | |
CN111414377B (en) | Method, device and storage medium for processing structured query statement | |
CN112214702A (en) | Method for improving webpage presentation speed | |
CN112069468B (en) | Page dynamic watermark method and device | |
CN111897711B (en) | Positioning method and device for bug in code, electronic equipment and readable storage medium | |
CN105677317A (en) | Method and apparatus for generating code documentation | |
CN113010169A (en) | Method and apparatus for converting UI diagram into code file | |
CN103077011B (en) | A kind of method and apparatus of pre-generatmg machine code instruction in JavaScript script | |
CN103326930A (en) | Automatic patrolling method and system for open platform interface | |
CN113590465B (en) | Method for automatically generating mock service based on SDK | |
US8161109B2 (en) | Client side culling of dynamic resources | |
CN113452613B (en) | Method, device, electronic equipment and storage medium for acquiring page routing address | |
CN110059559A (en) | The processing method and its electronic equipment of OCR identification file | |
CN112947985A (en) | Method and system for intelligently detecting and repairing codes | |
CN113821751B (en) | Browser optimization method and system, computer equipment and readable storage medium | |
CN108460276B (en) | Processing method and device for SO file of dynamic link library of android installation package | |
CN112860552B (en) | Keyword mechanism operation method and device | |
CN115455473A (en) | Method, device, equipment and storage medium for automatically processing sensitive words of electronic document | |
CN107766228A (en) | It is a kind of based on multilingual automated testing method and device | |
CN111078574A (en) | Method and device for generating influence analysis report |
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 | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20210112 |