Browse Prior Art Database

Incremental building method and system for the initial loading of JavaScript libraries Disclosure Number: IPCOM000236702D
Publication Date: 2014-May-09
Document File: 8 page(s) / 131K

Publishing Venue

The Prior Art Database


This invention develops a method in JavaScript library building system. It analyzes the dependencies between page-page and library-page and combines the developed JavaScript files into some big files, which will be downloaded only once in user's web navigation to the application. With this invention, a web application can build their JavaScript library files in an “optimal” division, which can keep the downloaded js file as small as possible, so that the performance(response time) is significantly improved, especially for loading the first page(initial loading).

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 24% of the total text.

Page 01 of 8

Incremental building method and system for the initial loading of JavaScript libraries

JavaScript is widely used in modern web applications. Together with HTML and CSS, it accomplishes interactive web pages and rich applications in browsers. The working mechanism for JavaScript is some kind of like downloading then running, in browser. Typically, a normal size web site may include megabyte level JavaScript scripts and hundreds of js files, which increase the web application response time. Actually, as mature css/image handling was developed and commonly used to improve web site loading performance, there are works worth doing on js build and loading.

A popular way to improve js loading is compress and package js files before web application deployment. Here we take a famous JavaScript framework - DOJO as an example. DOJO provides build-in js compressing and combination tool: called "DOJO Profile Build". By defining a profile file to describe JavaScript module dependencies, the DOJO build tools can combine all the js files in a web application into one or several js files, depending on how the profile file is defined. And with js compressing tools, DOJO can compress the(these) js file(s) into a compressed version, with redundant space removed and with local variables renamed to short ones. In this way, both the number of js files and also the file footprint are reduced. There will be only one(or just few) HTTP request(s) to loading js libs with smaller footprint. With the web cache mechanism, the js file needn't be loaded twice, when user visits the web site after the first time. So the loading performance of a web site are significantly improved.

Other popular js framework may have similar methods to do this work.

But this is not enough, especially in the initial loading time, for those rich client web applications with large quantity of js modules. Let's take a typical transportation management web application as example, even after js build, the initial loading response time will be over 10s in an average quality of WAN, and most of the time is spent on loading the compressed js file with a footprint about 5-10MB. The response time is still not meet the basic requirement, for a good user experience.

One way to improve it, is to divide the one large compressed js files into several and provide a on-demand loading for each. As a Prior Art, some js build tools have the capability to support js file combination into several rather than one js file.

However developers should specify complicated profiles, and it fully depends on the developers' understanding of page structure, js module(file) structure and their dependencies, which is very hard to realize. At the same time the granularity is not fine enough to do it in this way.

There are some automatic builder that can calculate js dependency-tree, and run some optimization in shrinking code. But these dependencies are not related to specify web-page, therefore can not optimize dire...