X-Git-Url: https://juplo.de/gitweb/?p=percentcodec;a=blobdiff_plain;f=cachecontrol%2Fsrc%2Fmain%2Fjava%2Fde%2Fhalbekunst%2Fjuplo%2Fcachecontrol%2FCacheControl.java;h=458979d9e63aa9142259f1001595288eff94aab3;hp=bf49a4530163aaa630d0fd88d7bd2c0f3d98876c;hb=fb4a82594d4ddc60e6fe342ff57203c8c0dcc085;hpb=253f47d8c14c361b6828107668fdb1dcc235d560 diff --git a/cachecontrol/src/main/java/de/halbekunst/juplo/cachecontrol/CacheControl.java b/cachecontrol/src/main/java/de/halbekunst/juplo/cachecontrol/CacheControl.java index bf49a453..458979d9 100644 --- a/cachecontrol/src/main/java/de/halbekunst/juplo/cachecontrol/CacheControl.java +++ b/cachecontrol/src/main/java/de/halbekunst/juplo/cachecontrol/CacheControl.java @@ -72,6 +72,15 @@ public class CacheControl { case HttpServletResponse.SC_PARTIAL_CONTENT: // 206 /** Normale Antwort! Antwort dekorieren... */ break; + case HttpServletResponse.SC_MOVED_PERMANENTLY: // 301 + case HttpServletResponse.SC_MOVED_TEMPORARILY: // 302 + case HttpServletResponse.SC_SEE_OTHER: // 303 + case HttpServletResponse.SC_NOT_MODIFIED: // 304 + case HttpServletResponse.SC_USE_PROXY: // 305 + case HttpServletResponse.SC_TEMPORARY_REDIRECT: // 307 + /** Redirect-Antwort! Antwort dekodieren... */ + // TODO: Kann das wirklich nicht zu Protokoll-Verletzungen führen? + break; case HttpServletResponse.SC_BAD_REQUEST: // 400 case HttpServletResponse.SC_UNAUTHORIZED: // 401 case HttpServletResponse.SC_PAYMENT_REQUIRED: // 402 @@ -120,7 +129,7 @@ public class CacheControl { } int cacheSeconds = handle.getCacheSeconds(request); - if (cacheSeconds < 1) { + if (cacheSeconds < 0) { log.debug("{}: caching disabled!", url); response.setDateHeader(Headers.HEADER_DATE, handle.getTimestamp()); response.setDateHeader(Headers.HEADER_EXPIRES, 0); @@ -328,7 +337,6 @@ public class CacheControl { cacheSeconds = CacheControl.this.defaultCacheSeconds; lastModified = CacheControl.this.defaultLastModified; - eTag = ""; /** Class-Level-Annotations auslesen */ for (Annotation annotation : handler.getClass().getAnnotations()) {