Minimize Number of JavaScript Files to Load"
(Created page with '{{ZKDevelopersGuidePageHeader}} = Overview = ZK loads the required JavaScript files only when it is required. It is similar to Java Virtual Machine's class loader, but ZK's Jav…') |
|||
Line 3: | Line 3: | ||
= Overview = | = Overview = | ||
− | ZK loads the required JavaScript files only when it is required. It is similar to Java Virtual Machine's class loader, but ZK's JavaScript loader loads a JavaScript package at once. It minimizes the number of bytes to be loaded to a browser. However, | + | ZK loads the required JavaScript files only when it is required. It is similar to Java Virtual Machine's class loader, but ZK's JavaScript loader loads a JavaScript package at once. It minimizes the number of bytes to be loaded to a browser. However, with an Internet connection, a Web page is loaded faster if the number of files to load is smaller (assuming the total number of bytes to transmit is the same). |
ZK, by default, loads both <tt>zul</tt> and <tt>zul.wgt</tt> packages when the <tt>zk</tt> package is loaded, since they are most common packages a ZK page might use. A ZK page generally uses more packages than that, and you, as an application developer, can pack them together to minimize the number of JavaScript files. | ZK, by default, loads both <tt>zul</tt> and <tt>zul.wgt</tt> packages when the <tt>zk</tt> package is loaded, since they are most common packages a ZK page might use. A ZK page generally uses more packages than that, and you, as an application developer, can pack them together to minimize the number of JavaScript files. | ||
− | Notice that the more packages you packed, the larger the file it is. It will then slow down the load time if some of packages are | + | Notice that the more packages you packed, the larger the file it is. It will then slow down the load time if some of packages are not required. Thus, only packed the packages that will be required by most of users. |
= Minimize the Number of JavaScript Files for a ZUL Page = | = Minimize the Number of JavaScript Files for a ZUL Page = |
Revision as of 05:54, 22 August 2010
This documentation is for an older version of ZK. For the latest one, please click here.
Overview
ZK loads the required JavaScript files only when it is required. It is similar to Java Virtual Machine's class loader, but ZK's JavaScript loader loads a JavaScript package at once. It minimizes the number of bytes to be loaded to a browser. However, with an Internet connection, a Web page is loaded faster if the number of files to load is smaller (assuming the total number of bytes to transmit is the same).
ZK, by default, loads both zul and zul.wgt packages when the zk package is loaded, since they are most common packages a ZK page might use. A ZK page generally uses more packages than that, and you, as an application developer, can pack them together to minimize the number of JavaScript files.
Notice that the more packages you packed, the larger the file it is. It will then slow down the load time if some of packages are not required. Thus, only packed the packages that will be required by most of users.
Minimize the Number of JavaScript Files for a ZUL Page
System-wide Minimizing the Number of JavaScript Files