Reputation: 53861
I have a large slow ASP.net site that uses master pages.
I've identified that the user will have a better experience if they can see the header and navigation while the rest of the page is being generated/processed/loaded from the database.
I've done some simple tests and I can do Response.Write() followed by Response.Flush() in page_load(), and IIs will use chunked encoding and send the output to the browser immediately while the rest of the page renders.
I want to do the same thing, but only send the master page header and navigation.
Any pointers on how to achieve this?
Using ASP.net 4 and IIs 7.5
Edit
If anyone can give some pointers on how to change the site to use AJAX without having to change every page and link, I'd appreciate it. Thanks!
Upvotes: 11
Views: 1709
Reputation: 24192
I suggest you use control caching. Asp.Net provides native caching of pages and controls. See these links to know more.
ASP.NET Caching: Techniques and Best Practices
http://msdn.microsoft.com/en-us/library/aa478965.aspx
ASP.NET Caching
http://msdn.microsoft.com/en-us/library/xsbfdd8c(v=VS.100).aspx
Control caching
As you have mentioned, it appears that you already use page-caching. Try using control-caching to further improve the caching. To use control caching, place PartialCachingAttribute
over the control class.
You can use the ControlCachePolicy
of the control to set caching behavior:
control.GetCachePolicy()
Upvotes: 2
Reputation: 3058
This might be helpful to you. I alway use yslow for FF alongwith firebug to check out the performance.
https://addons.mozilla.org/en-us/firefox/addon/yslow/
https://addons.mozilla.org/en-US/firefox/addon/firebug/
http://msdn.microsoft.com/en-us/library/ff647787.aspx
http://developer.yahoo.com/performance/rules.html
Thanks
Upvotes: 2
Reputation: 4968
I would suggest tracing the page, and try to figure out why exactly the page is rendering slow. The following might help...
And use DIVs in place of TABLEs!
Regarding AJAX usage, AFAIK... there is no shortcut. You can use AJAX script manager in your master page, and use the script manager proxy to the pages where you want to ajaxify the page. Change your Form to introduce an Update panel and you should be good for most pages.
Upvotes: 2
Reputation: 4422
If you flush the response stream at some point manually and do not manually set the content length it will enable chunked encoding.
This question seems related: How can I set Transfer-Encoding to chunked, explicitly or implicitly, in an ASP.NET response?
And this blog post talks about response flushing and chunked encoding: http://www.rahulsingla.com/blog/2010/06/asp-net-sets-the-transfer-encoding-as-chunked-on-premature-flushing-the-response
Upvotes: 3