[ 
https://issues.apache.org/jira/browse/SLING-11247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17786294#comment-17786294
 ] 

Carsten Ziegeler commented on SLING-11247:
------------------------------------------

I don't think we need to do anything in the core of Sling itself - this can 
easily be handled within a (custom) error handler.

> 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
>            Priority: Major
>
> 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.10#820010)

Reply via email to