html - When using a layout page in ASP.Net MVC is the layout loading every time a new page is called? -
i'm curious know, because i'm still learning layout pages, if when use layout page (ex. sitelayout.cshtml) , have 2 pages getting rendered (index.cshtml, results.cshtml) in @renderbody() section, layout wrapper part loaded each time go between index.cshtml , results.cshtml? or _layout.cshtml page load @renderbody() section asynchronously?
just throw in example pics
unless you've setup donut caching (http://weblogs.asp.net/scottgu/tip-trick-implement-donut-caching-with-the-asp-net-2-0-output-cache-substitution-feature), sitelayout.cshtml
executed separately every page.
if sitelayout has long/expensive operation , don't want loading every time, can use aforementioned donut caching have execute once per user per x amount of time.
if want sitelayout start sending data browser before body done executing/rendering (i.e. asynchronously overall speed purposes), can use nuget package called courtesyflush (http://www.hanselman.com/blog/nugetpackageoftheweekcourtesyflushtoflushbuffersearlierandoptimizetimetofirstbyte.aspx)
Comments
Post a Comment