protected boolean isEligibleToExpirationHeaderGeneration(HttpServletRequest request, XHttpServletResponse response) {
        boolean expirationHeaderHasBeenSet = response.containsHeader(HEADER_EXPIRES)
                || contains(response.getCacheControlHeader(), "max-age");
        if (expirationHeaderHasBeenSet) {
            if (logger.isDebugEnabled()) {
                logger.debug("Request '{}' with response status '{}' content-type '{}', expiration header already defined", new Object[] {
                        request.getRequestURI(), response.getStatus(), response.getContentType() });
            }
            return false;
        }

        for (int skippedStatusCode : this.excludedResponseStatusCodes) {
            if (response.getStatus() == skippedStatusCode) {
                if (logger.isDebugEnabled()) {
                    logger.debug(
                            "Request '{}' with response status '{}' content-type '{}', skip expiration header generation for given status",
                            new Object[] { request.getRequestURI(), response.getStatus(), response.getContentType() });
                }
                return false;
            }
        }

        return true;
    }