Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-11247

allow more lightweight error handling for non-HTML requests

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Servlets Resolver 2.9.4
    • None
    • Servlets
    • None

    Description

      Currently all errors in the request handling trigger the ErrorHandler in the SlingServletResolver [1], which for all non-JSON requests creates a HTML error page. This can be a heavyweight process as it is possible to render a full-blown error page.

      But this effort is often not helpful because this is error page is also rendered for a missing image; in this case the browser does not render the error page returned by this request for the image, but just a placeholder. Same for many other types of errors.

      Assuming that a CDN is able to handle all requests with a statuscode 200 already, and then the origin returns a lot of 404 responses, this can be a significant load on the backend, while creating "simple" 404s should be a very lightweight process.

      Thus it should be possible to enable a "short-cut" in the error handling, which just sends a very simple error page plus the statuscode in all cases where a full error page is not helpful.

      [1] https://github.com/apache/sling-org-apache-sling-servlets-resolver/blob/fda57eb9182cdb9560cf35944e7ff41da0f35ab7/src/main/java/org/apache/sling/servlets/resolver/internal/SlingServletResolver.java#L266

      Attachments

        Activity

          People

            Unassigned Unassigned
            joerghoh Joerg Hoh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: