diff --git a/src/fr/devinsy/kiss4web/SimpleServletDispatcher.java b/src/fr/devinsy/kiss4web/SimpleServletDispatcher.java index 317e15e..18d692e 100755 --- a/src/fr/devinsy/kiss4web/SimpleServletDispatcher.java +++ b/src/fr/devinsy/kiss4web/SimpleServletDispatcher.java @@ -45,6 +45,7 @@ public class SimpleServletDispatcher extends HttpServlet // static final protected Pattern LONG_REWRITED_URL_PARAMETERS = // Pattern.compile("^.+-/(.)+*$"); static final private Pattern REWRITE_PARAMETER = Pattern.compile("[^%\\w\\d]"); + static final public int CACHE_AGE = 60 * 60; private String webclassesRootPath; @@ -482,6 +483,10 @@ public class SimpleServletDispatcher extends HttpServlet contentDispositionToken = "inline"; } response.setHeader("Content-Disposition", contentDispositionToken + "; filename=\"" + file.getName() + "\""); + + response.setDateHeader("Expires", new Date().getTime() + CACHE_AGE * 1000); + response.setHeader("Cache-Control", "max-age=" + CACHE_AGE); + response.flushBuffer(); ServletOutputStream out = response.getOutputStream();