From 27d459e5484ff9bdc3d89cba15ec863913f1387c Mon Sep 17 00:00:00 2001
From: tpylak <tpylak>
Date: Thu, 3 Feb 2011 08:50:56 +0000
Subject: [PATCH] minor: change image cache from one week to 2h (url contains
 session url, so after the session ends the cache becomes useless)

SVN: 19735
---
 .../dss/generic/server/AbstractDatasetDownloadServlet.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/AbstractDatasetDownloadServlet.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/AbstractDatasetDownloadServlet.java
index 453a02f701b..48d4f7bca7f 100644
--- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/AbstractDatasetDownloadServlet.java
+++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/AbstractDatasetDownloadServlet.java
@@ -68,7 +68,7 @@ abstract public class AbstractDatasetDownloadServlet extends HttpServlet
 
     protected static final String CONTENT_TYPE_PNG = "image/png";
 
-    private static final long ONE_WEEK_IN_SECONDS = 60 * 60 * 24 * 7;
+    private static final long IMAGE_CACHE_AGE_IN_SECONDS = 60 * 60 * 2;
 
     private static final Size DEFAULT_THUMBNAIL_SIZE = new Size(100, 60);
 
@@ -225,7 +225,7 @@ abstract public class AbstractDatasetDownloadServlet extends HttpServlet
 
         if (CONTENT_TYPE_PNG.equals(responseStream.getContentType()))
         {
-            response.addHeader("Cache-Control", "max-age=" + ONE_WEEK_IN_SECONDS);
+            response.addHeader("Cache-Control", "max-age=" + IMAGE_CACHE_AGE_IN_SECONDS);
         }
 
         response.setContentType(responseStream.getContentType());
-- 
GitLab