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

enter image description here

enter image description here

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

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -