/** * Apply the given cache seconds and generate respective HTTP headers. * <p>That is, allow caching for the given number of seconds in the * case of a positive value, prevent caching if given a 0 value, else * do nothing (i.e. leave caching to the client). * @param response the current HTTP response * @param cacheSeconds the (positive) number of seconds into the future * that the response should be cacheable for; 0 to prevent caching; and * a negative value to leave caching to the client. * @param mustRevalidate whether the client should revalidate the resource * (typically only necessary for controllers with last-modified support) * @deprecated as of 4.2, in favor of {@link #applyCacheControl} */ @Deprecated protected final void applyCacheSeconds(HttpServletResponse response, int cacheSeconds, boolean mustRevalidate) { if (cacheSeconds > 0) { cacheForSeconds(response, cacheSeconds, mustRevalidate); } else if (cacheSeconds == 0) { preventCaching(response); } }
/** * Apply the given cache seconds and generate respective HTTP headers. * <p>That is, allow caching for the given number of seconds in the * case of a positive value, prevent caching if given a 0 value, else * do nothing (i.e. leave caching to the client). * @param response the current HTTP response * @param cacheSeconds the (positive) number of seconds into the future * that the response should be cacheable for; 0 to prevent caching; and * a negative value to leave caching to the client. * @param mustRevalidate whether the client should revalidate the resource * (typically only necessary for controllers with last-modified support) * @deprecated as of 4.2, in favor of {@link #applyCacheControl} */ @Deprecated protected final void applyCacheSeconds(HttpServletResponse response, int cacheSeconds, boolean mustRevalidate) { if (cacheSeconds > 0) { cacheForSeconds(response, cacheSeconds, mustRevalidate); } else if (cacheSeconds == 0) { preventCaching(response); } }
/** * Apply the given cache seconds and generate respective HTTP headers. * <p>That is, allow caching for the given number of seconds in the * case of a positive value, prevent caching if given a 0 value, else * do nothing (i.e. leave caching to the client). * @param response the current HTTP response * @param cacheSeconds the (positive) number of seconds into the future * that the response should be cacheable for; 0 to prevent caching; and * a negative value to leave caching to the client. * @param mustRevalidate whether the client should revalidate the resource * (typically only necessary for controllers with last-modified support) * @deprecated as of 4.2, in favor of {@link #applyCacheControl} */ @Deprecated protected final void applyCacheSeconds(HttpServletResponse response, int cacheSeconds, boolean mustRevalidate) { if (cacheSeconds > 0) { cacheForSeconds(response, cacheSeconds, mustRevalidate); } else if (cacheSeconds == 0) { preventCaching(response); } }