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
This commit is contained in:
Shawn Pearce 2013-05-18 18:48:41 -07:00 committed by Gerrit Code Review
parent 78734edfce
commit 7eef8edcba

View File

@ -72,17 +72,14 @@ public class CacheControlFilter implements Filter {
private static boolean cacheForever(final String pathInfo, private static boolean cacheForever(final String pathInfo,
final HttpServletRequest req) { final HttpServletRequest req) {
if (pathInfo.endsWith(".cache.html")) { if (pathInfo.endsWith(".cache.html")
return true; || pathInfo.endsWith(".cache.gif")
} else if (pathInfo.endsWith(".cache.gif")) { || pathInfo.endsWith(".cache.png")
return true; || pathInfo.endsWith(".cache.css")
} else if (pathInfo.endsWith(".cache.png")) { || pathInfo.endsWith(".cache.jar")
return true; || pathInfo.endsWith(".cache.swf")
} else if (pathInfo.endsWith(".cache.css")) { || pathInfo.endsWith(".cache.txt")
return true; || pathInfo.endsWith(".cache.js")) {
} else if (pathInfo.endsWith(".cache.jar")) {
return true;
} else if (pathInfo.endsWith(".cache.swf")) {
return true; return true;
} else if (pathInfo.endsWith(".nocache.js")) { } else if (pathInfo.endsWith(".nocache.js")) {
final String v = req.getParameter("content"); final String v = req.getParameter("content");