Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Custom 404 page slow to get into controller


I am currently trying to figure out why it takes a long time (60+ seconds) to get into the ErrorPageControllers Index action for a site with EPiServer 9.10 and Commerce. 

The custom error page is implemented as described here:

When trying a url that is incorrect directly under the start page it take a long time, if tryin a non-existing page under a sub-folder it does not take long time.


The commerce part is using HierarchicalCatalogPartialRouter to map commerce items into the main website. I have completely disabled that without any change in the slow loading of the custom 404 page. 

Even though it take time, it still loads the 404 page correctly.

How can I figure out what is taking up all that time for the incorrect URLs?


Jun 03, 2016 15:04

I'll use my standard tip: use static html pages for error pages and remember to turn off Episervers default error handling to avoid any infinite loops. There is a flag on application settings in web config file to turn off global error handling.

Use standard way to redirect to your static pages. Works every time. No Hazzle. Perfect performance. Some things you actually don't want to use Episerver for.

...and that's from someone who really likes to use Episerver for more or less everything :)

Jun 08, 2016 19:27

Had the same issue, solution:

(additionaly I`m using BVN404 Handler)

1) <customErrors mode="Off" />

2) global error handling => false

3) Set route -> routes.MapRoute("Error_404", "notfound", new { controller = "DefaultPage", action = "Error404" });

4) Use httpErrors to direct to Your 404 action (<error statusCode="404" path="/notfound" responseMode="ExecuteURL" />)

5) Controller:

public ActionResult Error404()
var startPage = ContentReference.StartPage.GetPage<StartPage>();
var notFoundPage = startPage.NotFoundPage.GetPage<StandardPage>();

Response.StatusCode = (int)HttpStatusCode.NotFound;
Response.TrySkipIisCustomErrors = true;
var model = CreateModel<StandardPage>(notFoundPage);

return View("~/Views/StandardPage/Index.cshtml", model);

Jun 09, 2016 12:32

Thanks for the replies.

When I get time I will try out Michal's suggestion and if that does not work we will switch to deliver static error pages as a fallback.

Jun 14, 2016 8:08


Did you manage to resolve the slowness issue. I have followed the steps provided but it still does not seem to help. The only step I am not 100% sure is below

2) global error handling => false

Could you please let me know if anything specific needs to be turned off.

If I use an html 404 page it loads instantly.

Kind Regards


Edited, Mar 13, 2018 2:23


Have just managed to figure it out

In order to resolve the issue you need specifically turn global error handling off

<applicationSettings globalErrorHandling="Off"

Kind Regards


Mar 13, 2018 22:12


 Have you guys considered using another tool?

I'm planning to use this on the new website we are building.



Mar 14, 2018 1:46

Hi Ram

Seems a slightly advance version as compared to BVN .

We have already implemented BVN in our current project so would be a lot of work for us to re-implement this and do all the testing again. A bit nervy also to use a relatively new module. BVN one is quite widely used and tested.

However please update the ticket with how you got along so that we can cosider it during our next project.

Kind regards


Mar 14, 2018 1:52
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.