Unlock instant, AI-driven research and patent intelligence for your innovation.

A front-end resource loading method and device

A resource and local resource technology, applied in the computer field, can solve problems such as blocked rendering, disordered page layout, and reduced efficiency, and achieve the effect of increasing speed and reducing traffic usage

Active Publication Date: 2018-01-23
TENCENT TECH (SHENZHEN) CO LTD
View PDF4 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] In the above prior art, when downloading the resource file, the rendering of the entire page will be blocked, and at the same time, the response to user interaction will be interrupted until the corresponding resource file is loaded and parsed, and the rendering of the page will not be resumed. When loading a resource file, even if the resource file has not been updated, the browser still needs to send enough requests to obtain the content of the resource. Too many requests will occupy network resources and reduce efficiency, and if a resource fails to load, it may cause Page layout disorder, interaction failure

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A front-end resource loading method and device
  • A front-end resource loading method and device
  • A front-end resource loading method and device

Examples

Experimental program
Comparison scheme
Effect test

no. 1 example

[0049] see image 3 , is a front-end resource loading method provided by the first embodiment of the present invention, which can be applied to figure 1 In the mobile terminal 100 shown, realize client-based front-end resource loading, the method includes:

[0050] S101. The client acquires and parses the webpage document of the target site, and the webpage document contains description information of front-end resources to be loaded;

[0051] A user accesses a WEB APP installed on a client. For ease of description, the embodiment of the present invention takes a browser APP installed on a smart phone as an example.

[0052] The user accesses the browser APP, and the browser APP obtains and parses the webpage document of the target site, wherein the target site may be a site corresponding to resource content on the homepage of the browser APP, and the webpage document may be an HTML document. The web page document includes description information of the front-end resources t...

no. 2 example

[0064] see Figure 4 , provides a front-end resource loading method for the second embodiment of the present invention, which can be applied to figure 1 In the mobile terminal 100 shown, realize client-based front-end resource loading, the method includes:

[0065] S201. The client acquires and parses the webpage document of the target site, and the webpage document contains description information of front-end resources to be loaded;

[0066] When the user accesses the browser APP, the browser APP acquires and parses the webpage document of the target site through the HTTP protocol, wherein the target site is a site corresponding to the resource content on the homepage of the browser APP, and the webpage document may be an HTML document. The web page document includes description information of the front-end resources to be loaded. The front-end resources to be loaded are the minimum set required for a single-page WEB APP to be executed smoothly, and are usually javaScript ...

no. 3 example

[0091] see Figure 5 , which provides a front-end resource loading device according to the third embodiment of the present invention. Such as Figure 5 As shown, the front-end resource loading device 40 includes:

[0092] An acquisition module 401, configured to acquire a web page document of the target site, the web page document includes description information of front-end resources to be loaded;

[0093] A parsing module 402, configured to parse the webpage document of the target site obtained by the acquiring module 401;

[0094] A judging module 403, configured to judge whether the to-be-loaded front-end resource is locally stored according to the description information of the to-be-loaded front-end resource;

[0095] The reading module 404 is configured to read the front-end resource to be loaded if the judging module 403 judges that the front-end resource to be loaded is locally stored;

[0096] The adding module 405 is used to add the locally stored front-end res...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The present invention relates to a front-end resource loading method and device, wherein the method includes: a client acquires and parses a webpage document of a target site, the webpage document contains description information of the front-end resource to be loaded; according to the description information of the front-end resource to be loaded , to determine whether the front-end resource to be loaded is stored locally; if yes, read the front-end resource to be loaded and add it to the webpage document; if not, request the server to download the front-end resource to be loaded, and download the The front-end resource is added to the webpage document; and the webpage document added to the front-end resource to be loaded is displayed. The above method and device can increase the speed of loading the required front-end resources when the client is not used for the first time, reduce the traffic occupied by loading, and reduce the interruption rate caused by loading the front-end resources when the client renders web pages.

Description

technical field [0001] The present invention relates to the field of computer technology, in particular to a front-end resource loading method and device. Background technique [0002] A single-page web application (SPA, single-page application) is a special kind of web application. It confines all activities in a Web page, and only loads the corresponding Hypertext Markup Language (HTML, HyperText Mark-up Language), JavaScript and Cascading Style Sheets (CSS, Cascading StyleSheets) when the Web page is initialized. Once the page load is complete, SPA will not reload or jump the page due to user actions. Instead, JavaScript is used to dynamically change the HTML content, thereby realizing the interaction between the user interface (UI, UserInterface) and the user. By avoiding page reloading, SPA can provide a smoother user experience. [0003] In the prior art, HTML tags are usually used to directly embed resource content or outlink resource files, or use the application ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F17/30
Inventor 廖晗成
Owner TENCENT TECH (SHENZHEN) CO LTD