code: public static void setExpires(@NotNull HttpServletResponse response, @Nullable Date date) {
      if (date == null) {
        response.setHeader(HEADER_EXPIRES, "-1");
      }
      else {
        response.setHeader(HEADER_EXPIRES, formatDate(date));
      }
    }
docs: Set expires header to given date.
  @param response Response
  @param date Expires date