code: private void configureCaching(HttpServletResponse response, int seconds) {
  		// HTTP 1.0 header
  		response.setDateHeader(HTTP_EXPIRES_HEADER, System.currentTimeMillis() + seconds * 1000L);
  		if (seconds > 0) {
  			// HTTP 1.1 header
  			response.setHeader(HTTP_CACHE_CONTROL_HEADER, "max-age=" + seconds);
  		} else {
  			// HTTP 1.1 header
  			response.setHeader(HTTP_CACHE_CONTROL_HEADER, "no-cache");
  
  		}
  	}
docs: Set HTTP headers to allow caching for the given number of seconds.
  
  @param response where to set the caching settings
  @param seconds number of seconds into the future that the response should be cacheable for