From f95a97aa11650ac183a24de026b03463f56f6779 Mon Sep 17 00:00:00 2001 From: Knut Forkalsrud Date: Mon, 11 Jul 2011 11:03:46 -0700 Subject: [PATCH] Tuning cache controls. In Chrome a reload sets the request header to max-age=0, but still includes an If-None-Match header. That means we sould not depend o a cached ETag, which we don't in any case. A shift-reload on the other hand sets the header to no-cache and does not include an If-None-Match header, meaning this is not a conditional get at all. --- src/main/java/org/forkalsrud/album/web/AlbumServlet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/forkalsrud/album/web/AlbumServlet.java b/src/main/java/org/forkalsrud/album/web/AlbumServlet.java index 8bf9cda..e0993fa 100644 --- a/src/main/java/org/forkalsrud/album/web/AlbumServlet.java +++ b/src/main/java/org/forkalsrud/album/web/AlbumServlet.java @@ -445,7 +445,7 @@ public class AlbumServlet boolean etagMatches(HttpServletRequest req, String fileEtag) { String cacheControl = req.getHeader("Cache-Control"); - if ("max-age=0".equals(cacheControl)) { + if ("no-cache".equals(cacheControl)) { return false; } String reqEtag = req.getHeader("If-None-Match");