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

resource caching broken when hiding zk version

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 8.6.1
    • Fix Version/s: 8.6.2
    • Component/s: Configuration
    • Security Level: Jimmy
    • Labels:
      None
    • gh.sprint.customfield.default.name:
      ZK 8.6.2 S1

      Description

      Steps to Reproduce

      hide the version information:

          <library-property>
              <name>org.zkoss.zk.ui.versionInfo.enabled</name>
              <value>false</value>
          </library-property>
      

      load any zul page containing dynamically loaded widget packages.
      e.g.:

      <zk>
        <textbox/>
      </zk>
      

      observe the URL loading the JS package zul.inp.wpd

      Current Result

      independent of the used ZK version this URL remains the same, effectively disabling the cache breaking mechanism for js packages:

      http://localhost:8080/zksupport85/zkau/web/js/zul.inp.wpd

      Expected Result

      a cache breaking part of the URL (obfuscating the actual version/built time)
      http://localhost:8080/zksupport85/zkau/web/_zv2018082816/js/zul.inp.wpd

      Debug Info

      Root Cause

      the version info is empty:
      https://github.com/zkoss/zk/blob/v8.6.1/zk/src/org/zkoss/zk/ui/http/WpdExtendlet.java#L646

      Workaround

      specify cache breaking <javascript-module> versions in a lang-addon.xml
      for all root packages loaded dynamically in the application (when upgrading the ZK version, also update the version string)

      e.g.: for "zul.inp" it is sufficient to specify a module version for the root "zul"

      <?xml version="1.0" encoding="UTF-8"?>
      <language-addon>
      	<addon-name>cache breaker</addon-name>
      	<javascript-module name="zk" version="my-version-1"/>
      	<javascript-module name="zul" version="my-version-1"/>
      	...
      </language-addon>
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rudyhuang rudyhuang
                Reporter:
                cor3000 cor3000
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 4 hours
                  4h
                  Remaining:
                  Time Spent - 2 hours Remaining Estimate - 2 hours
                  2h
                  Logged:
                  Time Spent - 2 hours Remaining Estimate - 2 hours
                  2h