This tutorial explains the approach to configure efficient error handling in AEM(Adobe Experience Manager).
AEM by default uses Sling’s Error handler to handle the error scenarios(/apps/sling/servlet/errorhandler), the publisher returns the error pages for Not Found Resources.
The publisher sends the default error page with 404 status to the Dispatcher, Dispatcher directly send back the error response with 404 error code to the user without caching the error response(spools the error responses directly to the client)
With the default Sling Error handler, all the websites display the same default error page to the users.
The default Sling Error handle can be overlayed to customize to enable site-specific custom error pages.
This can cause performance problems as the 404 pages are not cached in Dispatcher, this makes publishers to process and render the error pages on every not found resources, the multiple requests to the error pages can cause performance issues with AEM publishers. This can lead to a DDOS attack on the platform by sending multiple bad URLs by the attackers, the publisher should process the 404 pages for every request that makes the platform un-responsive for the intended users.
This behavior can be changed by allowing the webserver(Apache) to handle the error scenarios.