MVC 缓存错误页面

MVC cache error page

出现 404 错误时,我的应用程序重定向到页面 http://localhost:41083/hata/page-not-found

一旦我的页面 http://localhost:41083/iletisim/musterimiz-olun redirects to 404 page, even though I fix the error it still goes to 404 page, it does not hit the controller's action. However when I call the http://localhost:41083/Contact/CreateAccount 页面与未 url 重写的页面相同,它显示该页面没有任何问题。

那么它是通过url缓存页面吗?如果是这样,我该如何禁用它?我没有在操作中使用任何输出缓存,我的站点在 IIS Express 上运行。

我的路由配置和 ContactController:

routes.MapRoute(
    name: "musterimiz-olun",
    url: "iletisim/musterimiz-olun",
    defaults: new { controller = "Contact", action = "CreateAccount" },
    namespaces: new[] { "OyakCorporate.Controllers" }
);

public ActionResult CreateAccount()
{
    return View();
}

在 Global.asax 上的 Application_Error() 方法中使用 Redirect() 而不是 RedirectPermanent() 解决了问题。