diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-11-29 13:31:44 +0000 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2012-11-29 13:31:44 +0000 |
commit | 54665ea8ee6cc091eb3409c3f1476a30d11c7af2 (patch) | |
tree | 1a57ecfd29691b6a9f6200bb4622a3beb7e10b6d | |
parent | 2e3be58af26743504d8563b38128a1c3f33ee5bc (diff) | |
parent | 95ed623fc702fd2cfdd78224476569554c44230b (diff) | |
download | vaadin-framework-54665ea8ee6cc091eb3409c3f1476a30d11c7af2.tar.gz vaadin-framework-54665ea8ee6cc091eb3409c3f1476a30d11c7af2.zip |
Merge "Use max-age 0 for *nocache* instead of the default 1h #10421"
-rw-r--r-- | server/src/com/vaadin/server/VaadinServlet.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/server/src/com/vaadin/server/VaadinServlet.java b/server/src/com/vaadin/server/VaadinServlet.java index a285c327eb..0ad4dea37d 100644 --- a/server/src/com/vaadin/server/VaadinServlet.java +++ b/server/src/com/vaadin/server/VaadinServlet.java @@ -870,8 +870,12 @@ public class VaadinServlet extends HttpServlet implements Constants { */ int resourceCacheTime = getService().getDeploymentConfiguration() .getResourceCacheTime(); - response.setHeader("Cache-Control", - "max-age= " + String.valueOf(resourceCacheTime)); + String cacheControl = "max-age=" + + String.valueOf(resourceCacheTime); + if (filename.contains("nocache")) { + cacheControl = "public, max-age=0, must-revalidate"; + } + response.setHeader("Cache-Control", cacheControl); } // Write the resource to the client. |