Browse Prior Art Database

A Context Based Approach to Compressing Javascript Libraries

IP.com Disclosure Number: IPCOM000192725D
Original Publication Date: 2010-Feb-01
Included in the Prior Art Database: 2010-Feb-01
Document File: 2 page(s) / 20K

Publishing Venue

IBM

Abstract

Disclosed is a context based approach to compressing JavaScript libraries for a particular Web application that uses the libraries. This is made by scanning and analyzing the web pages in the application, and removing the JavaScript code unreferenced by any web page from the libraries.

This text was extracted from a PDF file.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 58% of the total text.

Page 1 of 2

A Context Based Approach to Compressing Javascript Libraries

Disclosed is a context based approach for JavaScript library compression.

Modern Web applications make use of various JavaScript libraries. Today's JavaScript libraries become increasingly large, especially in the web
2.0 era. Large Javascript libraries increase network burden considerably and can cause Web applicationperformance issues.

In order to ease the network burden and improve theWeb application's performance, JavaScript library compression becomes a widely used technique nowadays. This invention compresses the Javascript libraries through a context based approach, where context means a particular Web application that uses the library, based on the facts that:
a. A particular Web application typically only usesa portion (sometimes a small portion) of a particular library
b. The application has to import the whole library (Javascript files) in order to use a portion of itscode
c. The client browser has to download the whole library while some code will never be used

This invention finds out and removes the code of the library that never used in a particular Web application before deployment. This is done at building phase. A procedure scans and analyzes all the web pages that use the Javascript library to:
a. Find out identifiers (variables, functions and classes) referenced direct...