From 7eef8edcba77058e4112c87b2d220517265b412d Mon Sep 17 00:00:00 2001 From: Shawn Pearce Date: Sat, 18 May 2013 18:48:41 -0700 Subject: [PATCH] Allow *.cache.{txt,js} to cache forever These extensions are also written out by the GWT compiler for resources embedded as part of a ClientBundle. Change-Id: I3e3f774ed80a06698e360f7d5d6c3f0cfed3a230 --- .../gwtexpui/server/CacheControlFilter.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/gerrit-gwtexpui/src/main/java/com/google/gwtexpui/server/CacheControlFilter.java b/gerrit-gwtexpui/src/main/java/com/google/gwtexpui/server/CacheControlFilter.java index c4d681f900..2033c6274a 100644 --- a/gerrit-gwtexpui/src/main/java/com/google/gwtexpui/server/CacheControlFilter.java +++ b/gerrit-gwtexpui/src/main/java/com/google/gwtexpui/server/CacheControlFilter.java @@ -72,17 +72,14 @@ public class CacheControlFilter implements Filter { private static boolean cacheForever(final String pathInfo, final HttpServletRequest req) { - if (pathInfo.endsWith(".cache.html")) { - return true; - } else if (pathInfo.endsWith(".cache.gif")) { - return true; - } else if (pathInfo.endsWith(".cache.png")) { - return true; - } else if (pathInfo.endsWith(".cache.css")) { - return true; - } else if (pathInfo.endsWith(".cache.jar")) { - return true; - } else if (pathInfo.endsWith(".cache.swf")) { + if (pathInfo.endsWith(".cache.html") + || pathInfo.endsWith(".cache.gif") + || pathInfo.endsWith(".cache.png") + || pathInfo.endsWith(".cache.css") + || pathInfo.endsWith(".cache.jar") + || pathInfo.endsWith(".cache.swf") + || pathInfo.endsWith(".cache.txt") + || pathInfo.endsWith(".cache.js")) { return true; } else if (pathInfo.endsWith(".nocache.js")) { final String v = req.getParameter("content");