Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-1889

zul.lang.wpd is always loaded twice with some JS package merge configurations


    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 6.5.4
    • 6.5.3
    • ZK Loader
    • Security Level: Jimmy
    • None

      When using configuration where multiple JS packages are merged to zk.wpd, zul.lang.wpd package gets loaded twice from different URLs (once from HTML and once from JS).

      Example configuration:

        <!-- core packages -->
        <javascript package="zhtml" merge="true" />
        <javascript package="zul.utl" merge="true" />
        <javascript package="zul.menu" merge="true" />
        <javascript package="zul.box" merge="true" />
        <javascript package="zul.wnd" merge="true" />
        <!-- dependent packages -->
        <javascript package="zul.mesh" merge="true" />  <!-- depends on zul.menu -->
        <javascript package="zul.sel" merge="true" />   <!-- depends on zul.mesh -->
        <javascript package="zul.grid" merge="true" />  <!-- depends on zul.mesh -->
        <!-- removing these packages fixes the issue -->
        <javascript package="zk.fmt" merge="true" />    <!-- depends on zul.lang -->
        <javascript package="zul.inp" merge="true" />   <!-- depends on zul.lang, zk.fmt -->
        <javascript package="zul.db" merge="true" />    <!-- depends on zk.fmt, zul.inp -->

      I think what happens is this:
      1. Page is loaded, first script tag points to zk.wpd
      2. zk.wpd is processed, submitting requests for required JS packages (including zul.lang.wpd, even though it would be loaded later anyway)
      3. Second script tag in HTML points to zul.lang.wpd, so it gets loaded again

      While zul.lang.wpd file is very small, it can not be cached, so it must be unneccesarily loaded from server the second time on every page hit.

            RaymondChao RaymondChao
            gediminas gediminas
            0 Vote for this issue
            0 Start watching this issue