-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Normal
-
Affects Version/s: 8.6.0.1
-
Component/s: Configuration, Container
-
Security Level: Jimmy
-
Environment:
currently reproduced on FF (but technically browser independent)
running on Jetty 9.4.14.v20181114
-
ZK 8.6.1 S1
-
None
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