-
Bug
-
Resolution: Done
-
Major
-
None
-
None
-
None
See the following excerpt from ResourceHandler. It is setting cache headers regardless of whether the resource is found. In my case, I have a next handler that can return a 404 or 500 status, both of which are being cached by some browsers.
//we set caching headers before we try and serve from the cache if (cachable && cacheTime != null) { exchange.getResponseHeaders().put(Headers.CACHE_CONTROL, "public, max-age=" + cacheTime); long date = System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(cacheTime); String dateHeader = DateUtils.toDateString(new Date(date)); exchange.getResponseHeaders().put(Headers.EXPIRES, dateHeader); } if (cache != null && cachable) { if (cache.tryServeResponse()) { return; } }