Optimized delivery of web application code
Abstract
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.
Claims
exact text as granted — not AI-modified1 . A procedure for optimizing application code for deployment to a client over a data link, wherein only the code needed by a given object within said application is supplied to the client with said object, said procedure comprising the steps of:
providing means for parsing said code; using said parsing means, scanning said application code to identify all entry points and all available resources, wherein an entry point comprises a resource call; determining which of said resources are required by said object; and concatenating said required resources into a single file; wherein said single file contains only code required by said object, so that download time for said application code is minimized.
2 . The procedure of claim 1 , wherein said application comprises a web application, and wherein said object comprises a web page, said web application including at least one web page that includes at least one functionality, said web page comprising a file of HTML (hypertext markup language) code, said web page optionally including embedded code blocks written in a scripting language, said application further comprising one or more import files of code written in said scripting language.
3 . The procedure of claim 2 , wherein said scripting language is comprises any of JAVASCRIPT and VBSCRIPT.
4 . The procedure of claim 2 , wherein said resources are located in one or both of said embedded code sections and said import files.
5 . The procedure of claim 3 , wherein said step of scanning said application code to identify entry points comprises the steps of:
scanning said HTML code; scanning said embedded code sections; scanning said import files; and identifying entry points contained therein.
6 . The procedure of claim 5 , wherein said entry points include any of:
HTML tags that incorporate JAVASCRIPT statements; actions associated with web page elements; and DOM (document object model) events.
7 . The procedure of claim 6 , wherein said actions associated with web page elements include HTML form actions.
8 . The procedure of claim 5 , wherein identifying all available resources comprises the steps of:
identifying said embedded code sections and said import files; identifying all available resources contained therein; creating a resource information object for each resource; and creating at least one list of said information objects.
9 . The procedure of claim 8 , wherein said resources include any of:
functions; virtual functions; methods; procedures; sub-routines; and any code block that performs a specific task.
10 . The procedure of claim 9 , wherein a virtual function comprises a placeholder in said HTML code, and wherein a virtual function includes either of:
instructions and resources contained in said embedded code blocks; where a web page element invokes a plurality of functions, said plurality of functions.
11 . The procedure of claim 8 , wherein said resource information object includes:
resource name; methods called by said resource; optionally, implementation of said resource; optionally, source file; an is-used' field; and an ‘is-real’ field.
12 . The procedure of claim 11 , wherein said ‘is-used’ and said is-rear fields are Boolean fields, said ‘is-used’ field being set to denote a resource required b y said web page, and said is-real field' left unset to denote a virtual function.
13 . The procedure of claim 12 , wherein said step of creating at least one list of said information objects comprises the step of:
creating an array of said resource information objects.
14 . The procedure of claim 13 , wherein said step of creating at least one list of said information objects further comprises the step of creating a hash map of said information objects, wherein keys in said hash map comprise resource names and corresponding values comprise information objects for the named resources.
15 . The procedure of claim 13 , wherein said step of determining which of said resources are required by said object comprises the steps of:
for each entry point, following a call path to identify required resources; for each resource encountered on said call path, setting said ‘is-used’ field.
16 . The procedure of claim 15 , wherein said call path is followed until any of:
a resource is encountered that doesn't call any other resources; a resource is encountered that calls a system function; a resource is encountered that already has the ‘is-used’ field set.
17 . The procedure of claim 16 , wherein said step of compiling said required resources into a single file comprises the steps of:
writing each resource for which the ‘is-used’ field is set to a new import file, wherein said resources are written to said new import file in the order that they occur in said application code; and updating said application code to refer to said new import file.
18 . The procedure of claim 1 , wherein said parsing tool incorporates:
IO support; and Support for collections, arrays, and hash maps.
19 . The procedure of claim 18 , wherein said parsing tool comprises one of:
a PERL script; and a JAVASCRIPT engine.
20 . The procedure of claim 1 , wherein said single file is held in said client's cache after downloading, so that it need be downloaded only once.Join the waitlist — get patent alerts
Track US2016019047A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.