public static List<Pair<String, String>> getCachingHeadersToSet(int ttl, boolean noProxy) { return getCachingHeadersToSet(ttl, null, null, noProxy); }
public static List<Pair<String, String>> getCachingHeadersToSet(int ttl, boolean noProxy) { return getCachingHeadersToSet(ttl, null, null, noProxy); }
public static List<Pair<String, String>> getCachingHeadersToSet(int ttl, boolean noProxy) { return getCachingHeadersToSet(ttl, null, null, noProxy); }
/** * Sets HTTP headers that instruct the browser to cache content. Implementations should take care * to use cache-busting techniques on the url if caching for a long period of time. * * @param response The HTTP response * @param ttl The time to cache for, in seconds. If 0, then insure that * this object is not cached. * @param noProxy True if you don't want the response to be cacheable by proxies. */ public static void setCachingHeaders(HttpServletResponse response, int ttl, boolean noProxy) { for (Pair<String, String> header : getCachingHeadersToSet(ttl, noProxy)) { response.setHeader(header.one, header.two); } }
/** * Sets HTTP headers that instruct the browser to cache content. Implementations should take care * to use cache-busting techniques on the url if caching for a long period of time. * * @param response The HTTP response * @param ttl The time to cache for, in seconds. If 0, then insure that * this object is not cached. * @param noProxy True if you don't want the response to be cacheable by proxies. */ public static void setCachingHeaders(HttpServletResponse response, int ttl, boolean noProxy) { for (Pair<String, String> header : getCachingHeadersToSet(ttl, noProxy)) { response.setHeader(header.one, header.two); } }
/** * Sets HTTP headers that instruct the browser to cache content. Implementations should take care * to use cache-busting techniques on the url if caching for a long period of time. * * @param response The HTTP response * @param ttl The time to cache for, in seconds. If 0, then insure that * this object is not cached. * @param noProxy True if you don't want the response to be cacheable by proxies. */ public static void setCachingHeaders(HttpServletResponse response, int ttl, boolean noProxy) { for (Pair<String, String> header : getCachingHeadersToSet(ttl, noProxy)) { response.setHeader(header.one, header.two); } }
/** * Sets HTTP headers that instruct the browser to cache content. Implementations should take care * to use cache-busting techniques on the url if caching for a long period of time. * * @param response The HTTP response * @param ttl The time to cache for, in seconds. If 0, then insure that * this object is not cached. * @param noProxy True if you don't want the response to be cacheable by proxies. */ public static void setCachingHeaders(HttpServletResponse response, int ttl, boolean noProxy) { for (Pair<String, String> header : getCachingHeadersToSet(ttl, noProxy)) { response.setHeader(header.one, header.two); } }
/** * Sets HTTP headers that instruct the browser to cache content. Implementations should take care * to use cache-busting techniques on the url if caching for a long period of time. * * @param response The HTTP response * @param ttl The time to cache for, in seconds. If 0, then insure that * this object is not cached. * @param noProxy True if you don't want the response to be cacheable by proxies. */ public static void setCachingHeaders(HttpServletResponse response, int ttl, boolean noProxy) { for (Pair<String, String> header : getCachingHeadersToSet(ttl, noProxy)) { response.setHeader(header.one, header.two); } }
public static void setCachingHeaders(HttpResponseBuilder response, int ttl, boolean noProxy) { for (Pair<String, String> header : HttpUtil.getCachingHeadersToSet(ttl, noProxy)) { response.setHeader(header.one, header.two); } }
public static void setCachingHeaders(HttpResponseBuilder response, int ttl, boolean noProxy) { for (Pair<String, String> header : HttpUtil.getCachingHeadersToSet(ttl, noProxy)) { response.setHeader(header.one, header.two); } }
public static void setCachingHeaders(HttpResponseBuilder response, int ttl, boolean noProxy) { // Initial cache control headers are in this response, we should now sanitize them or set them if they are missing. String cacheControl = response.getHeader("Cache-Control"); String pragma = response.getHeader("Pragma"); for (Pair<String, String> header : HttpUtil.getCachingHeadersToSet(ttl, cacheControl, pragma, noProxy)) { response.setHeader(header.one, header.two); } }