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

enabling etag produces 304 with non empty response body

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.6.1
    • 8.6.0.1
    • Configuration, Container
    • Security Level: Jimmy
    • currently reproduced on FF (but technically browser independent)
      running on Jetty 9.4.14.v20181114

    • ZK 8.6.1 S1

      Steps to Reproduce

      enable the library property org.zkoss.web.classWebResource.cache.etag

      Load any ZK page 2x (so that the browser has a chance to cache resources)
      Observe the server logs

      Actual Result

      Jan 09, 2019 2:01:53 PM org.eclipse.jetty.server.HttpChannel handleException
      WARNING: /zksupport86/zkau/web/e4f69fb4/_zkiju-breeze/zul/css/zk.wcs java.io.IOException: org.eclipse.jetty.http.BadMessageException: 500: Content for no content response
      Jan 09, 2019 2:01:53 PM org.eclipse.jetty.server.HttpChannel handleException
      WARNING: /zksupport86/zkau/web/e4f69fb4/js/zk.wpd java.io.IOException: org.eclipse.jetty.http.BadMessageException: 500: Content for no content response
      

      Similar error messages should appear on other servers as well.

      Expected Result

      no error, empty response body for status 304
      (following the HTTP spec https://tools.ietf.org/html/rfc2616#section-10.3.5)

      Debug Info

      browsers dev tools often disable caching, also other ZK config settings might disable resource caching in the browser

      Root Cause

      org.zkoss.zk.fn.JspFns#setCacheControl() returns a boolean value indicating a 304 status, which is ignored in Wcs/WpdExtendlet (also org.zkoss.zk.fn.DspFns#setCacheControl)

      https://github.com/zkoss/zk/blob/v8.6.0.1/zk/src/org/zkoss/zk/ui/http/WcsExtendlet.java#L96
      https://github.com/zkoss/zk/blob/v8.6.0.1/zk/src/org/zkoss/zk/ui/http/WpdExtendlet.java#L200

            rudyhuang rudyhuang
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Time Spent - 3 hours Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - 3 hours Remaining Estimate - 1 hour
                3h