if (!cacheable.isGenerateCacheHeaders(request))
return true;
+ String url = null;
+ if (log.isDebugEnabled()) {
+ if (request.getQueryString() == null) {
+ url = request.getRequestURI();
+ }
+ else {
+ StringBuilder builder = new StringBuilder();
+ builder.append(request.getRequestURI());
+ builder.append('?');
+ builder.append(request.getQueryString());
+ url = builder.toString();
+ }
+ }
+
int cacheSeconds = cacheable.getCacheSeconds(request);
if (cacheSeconds < 0) {
- log.debug("{}: caching disabled!", request.getRequestURI());
+ log.debug("{}: caching disabled!", url);
response.setDateHeader(HEADER_DATE, now);
response.setDateHeader(HEADER_EXPIRES, 0);
response.addHeader(HEADER_PRAGMA, "no-cache");
* negative Werte für Last-Modified zurückliefert.
*/
if (log.isDebugEnabled())
- log.debug("Not modified since {}: {}", new Date(ifModifiedSince), request.getRequestURI());
+ log.debug("Not modified since {}: {}", new Date(ifModifiedSince), url);
if (ifNoneMatch == null) {
/** Neue Anfrage oder HTTP/1.0 Client! */
- log.debug("ETag nicht gesetzt: 304 {}", request.getRequestURI());
+ log.debug("ETag nicht gesetzt: 304 {}", url);
response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
return false;
}
}
if (ifNoneMatch != null && ifNoneMatch.equals(eTag)) {
- log.debug("{}: ETag {} not changed -> 304 ", request.getRequestURI(), ifNoneMatch);
+ log.debug("{}: ETag {} not changed -> 304 ", url, ifNoneMatch);
response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
return false;
}
- log.debug("{}: first up!", request.getRequestURI());
+ log.debug("{}: first up!", url);
/** HTTP/1.1-Caching-Header richtig setzen!! */
response.setDateHeader(HEADER_LAST_MODIFIED, lastModified);