Optimized Delivery of Web Application Code
Application code for deployment to a client over a data link is optimized to minimize download time by supplying only the application code with a particular object that is required by the object. In a web application that includes multiple pages, the HTML and JAVASCRIPT are scanned to identify code resources called by a particular web page. When all called resources are identified, they are extracted and concatenated into a single resource file. When the page is downloaded to the client, the import file is included with the page. The import file may be cached so that it need only be downloaded once, rather than being downloaded every time the page is requested. The invention is suitable for use with other interpreted scripting languages.
1 . A computer implemented method for optimizing application code for deployment to a client over a data link, wherein only the code needed by a first object within said application code is supplied to the client with said first object, said method comprising the steps of:
parsing said application code;
scanning said application code;
identifying all entry points into said application code;
identifying available resources of said application code;
determining which of said resources are required by said first object;
creating a resource information object for each of said resources required by said first object, wherein said resource information object comprises a field set to denote resource requirement; and
concatenating required resources into a single file;
wherein said single file contains only code required by said first object, such that download time for said application code is minimized.