pages "think" before loading

eramgarden

Contributor
Joined
Mar 8, 2004
Messages
579
So, I moved my code to the production environment. I had "debug='true'" in web.config.

I looked at how the page loads on couple of user's machines and the pages seem to 'think' before the load. For example, on one of the pages, I have a datagrid and next to it, i have 7 linkbuttons. When this page loads, I see the 7 linkbuttons on top of the page, no grid, then it renders and everything looks fine...

I found this link: http://aspnetresources.com/articles/debug_code_in_production.aspx

so I changed webconfig in production to debug=false..

BUT the page still 'thinks' before it loads..happens on some of the pages...

Do i need to recompile and move the dll as well?? any ideas?
 
A few thoughts - none of which might be happening.

1. Whenever you "push" new ddls to your webserver or change web.config ASP.Net has to recache - so there's always a noticeable delay the first time a page is hit after either of those events. I'm not sure what the lifetime of the cache is but it seems to me that if your site/pages are dormant for quite a while that you see the recache too. You should be using 'release' versions of your assemblies on your 'live' server if you're not.

You most likely develop on your box (Visual Studio and IIS on the same machine). You might use a local database for development (which would make data access very fast) or might use a networked test database (which can be a wee bit slower and more realistic for comparing dev data performance to live data performance).

Do you see a delay on the client machines in how long it takes the browser to receive data (you'd see the activity icon in the browser going)? Or, after the activity stops is there a pause before the page renders?

2. Now that your application is running over a network or the internet (as opposed to a stand-alone dev environment) there could be some delays for clients hitting the server. Also, if your page involves a lot of data it might take a while to download the page from the server to the client even on a decent network (for ex one massively bloated page I'm redesigning produces about 2.5-3.5MB of html....*whistles innocently*...my users LOVE it...and my boss loves giving me neverending grief about it...our intranet is generally fast but if there's any congestion at all there's a noticeable download of this particular page)

My development machine is slower than my home machine. Generally speaking - average users on our intranet have slower machines with less RAM than any given developer. Our company is a child of a parent company on the same intranet and we do their web apps - and a lot of their users have utterly archaic computers that I wouldn't hand down to a distant relative.

3. It might be possible that a complex page html-wise renders fast on your development machine but renders more slowly on lesser client machines. This can be particularly true if you have a lot of data in your page that creates a lot of display elements - like html tables produced by grid or repeater controls and/or (as I often create) repeaters or other repeating elements with lots of nested controls. (to continue to haze myself for my poor UI mentioned previously - it's also data/control intensive and there's a very noticeable delay AFTER the page downloads to the client while the browser chokes and renders - I can literally count off a few seconds on client machines).

4. If you app involves a lot of data then the way you connected to data in development might be different from your live deployment and could be a factor. Hitting data entirely locally can be slower than hitting data over a network - depending on the network. Also in terms of application performance you generally want to minimize database hits as they're something that can easily be a bottleneck. So, some data factors can affect how an app performs in local dev vs. live.

If you staggered page loading is being caused by network issues you might be able to setup your page to transmit as a whole instead of in chunks.

If it's slow client machines choking up on large quantities of complex html the only real solution is to refine your application.

If data access is slowing you down there could be a lot of different things you could consider.

And, of course, none of this may apply to you and I could just be rambling.

Paul
 
Thanks for the explanation, i think part of it could be the data being pulled back...

1. I compile on my laptop, i had debug='true'. I changed it to debug='false' but still saw the same 'thinking'.

2. Isnt changing "debug=false" the same as release mode?? How do I compile in "release mode"??
 
In visual studio there should be a drop down on the toolbar that allows you to select between debug and release.
Also does this delay occur for all users or just the first one to access the webpage?

If for all users it may be worth investigating either Output Caching or using the Cache object in code to reduce the amount of calls to the database.
 
Thanks, I'll recompile using the release mode and see..

Since this is a new app, not a lot of people are using it..whenever i see it happening, i think only one person is using it...

It does NOT happen on my laptop (my development box). It does happen on my laptop when I use the production URL...

That page has a datagrid, and maybe 7 dropdownlists, everything is loaded into the conrols via StoredProc...

I'm using NO caching...this is my first asp.net project but i will look into that..
 
On my pages, i have maybe 2 or more "tables"...I put the linkbuttons on one side of the page, in a table..and these linkbuttons are the ones that showup first when the page loads..

Could be the cause of it??

I pointed my laptop to production database and i dont see this "thinking"...so I think only happening on the production machine...I've also noticed it on out TEST machine..

To answer Paul's question, I do see the "activity icon" going, and then the page renders and it stops..
 
Back
Top