Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Slow first response when using Views

$
0
0

It seems that the first view load takes noticeably more time than when the controller does not use view and just return something like Content("<html>....</html>").

[Route("/with_view")]
public IActionResult with_view()
{
return View("with_view");
}

[Route("/without_view")]
public IActionResult without_view()
{
return Content("<html>....</html>");
}

The "without_view" response is almost instant, while "with_view" takes a few seconds. Is there any way to precompile the views?


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>