* i2psnark: Send cache directive for in-war icons

This commit is contained in:
zzz
2010-12-31 13:14:57 +00:00
parent a18197dbdd
commit 95cf306526

View File

@ -99,6 +99,17 @@ public class I2PSnarkServlet extends Default {
return _resourceBase.addPath(pathInContext);
}
/**
* Tell the browser to cache the icons
* @since 0.8.3
*/
@Override
public void handleGet(HttpServletRequest request, HttpServletResponse response, String pathInContext, Resource resource, boolean endsWithSlash) throws ServletException, IOException {
if (resource.getName().startsWith("jar:file:"))
response.setHeader("Cache-Control", "max-age=86400"); // cache for a day
super.handleGet(request, response, pathInContext, resource, endsWithSlash);
}
/**
* Some parts modified from:
* <pre>