4

I have a (big) problem that all of you that work with Webforms might have.

The problem is the time to load a page. Using localhost (witch should be the fastest mode) in Vista (IIS 7) I get this graph

alt text http://www.balexandre.com/temp/2009-06-29_1302_soquestion.png

original file link

as you can see, it takes more than 17 seconds to show the page!!! and only 2 seconds to load the page it self...

I'm using the ASP.NET AJAX framework to work with Web Parts.

How can I reduce this 17 seconds?

Any idea on where to go is greatly appreciated :)


Added: Test for correct answer from Jan Zich

I tested changing

<asp:ScriptManager ID="sm" runat="server" />

into

<ajax:ToolkitScriptManager ID="sm" runat="server" CombineScripts="true" />

and the result using FireBug is impressive (half of the time, and not using the cache!) as you can see in the image below

alt text http://www.balexandre.com/temp/2009-06-29_1543_soquestion.png

original file link

and with CSS and jQuery files cached, drops to half of it!

alt text http://www.balexandre.com/temp/2009-06-29_1550_soquestion.png

original file link

Community
  • 1
  • 1
balexandre
  • 73,608
  • 45
  • 233
  • 342

3 Answers3

4

This won’t count as a valid answer because I don’t know how to actually fix that, but the problem is that most browsers (besides Safari and Chrome perhaps) load JavaScript sequentially because it’s necessary to wait for the previous script to finish executing (as it may change the document). This is typically fixed by combining all JavaScript files into one.

Edit: Related question: How do I combine WebResource.axd and ScriptResource.axd files so as to result in less requests to my ASP.NET server?. Also, I cannot see what scripts you are actually including from the screenshot, but most likely it's your custom scripts. Is there a way in your application to combine them in some way?

Community
  • 1
  • 1
Jan Zich
  • 14,993
  • 18
  • 61
  • 73
  • that's a great point, and I remember to see that documentation, but I never associate it to my current problem. I will read this again and try to combine the scripts! Thank you so much for this insight view :) – balexandre Jun 29 '09 at 11:57
1

Keep in mind, that when debug mode is enabled (in web.config: <compilation debug="true">), resources such as javascript files, images and CSS files are not cached by the browser.

Therefore, in a production-environment (with debug disabled), these numbers might look different, since the browser will cache most of the resources and not request them again for each page/request.

M4N
  • 94,805
  • 45
  • 217
  • 260
  • Nice point, but I do have all my pages to not allow cache, because of where I'm showing this page (inside a CRM application) so it would be the same... but thank you anyway. – balexandre Jun 29 '09 at 12:03
0

Do you use an UpdatePanel which loads a lot of data? If so, the page won't render until it fetches all the data.

It's possible to extend the UpdatePanel however to show before loading your data - this article describes how to do it (alas, in Dutch, but I believe the comments inside the code were in English)

Ben
  • 791
  • 6
  • 12
  • "UpdatePanel which loads a lot of data"... it's a little more than that, but I understand what you say, but no, in this page is only WebParts, all ajax related is done by me using jQuery. But thanks anyway. – balexandre Jun 29 '09 at 12:02