Joerg Hoh created SLING-11247:
---------------------------------
Summary: allow more lightweight error handling for non-HTML
requests
Key: SLING-11247
URL: https://issues.apache.org/jira/browse/SLING-11247
Project: Sling
Issue Type: Improvement
Components: Servlets
Affects Versions: Servlets Resolver 2.9.4
Reporter: Joerg Hoh
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
--
This message was sent by Atlassian Jira
(v8.20.1#820001)