• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2418
  • Last Modified:

Make .aspx page load faster

Why do .aspx pages take so long to load than .html or .php pages? And how can I make 'em load quicker?
0
John Account
Asked:
John Account
  • 6
  • 3
  • 2
  • +4
1 Solution
 
renjurdevanCommented:
Strategies like avoiding unnecessay Viewstate Usage, Unnecessay appending of stings in loops, fetching unwanted data from database through queries like "select * from xxxx" even you want limited fields..etc....

in the case you should be very specific like
select name,age from xxx
and use appropriate where clause in queries if applicable..

You can use handlers .. well written Handlers are quicker than usual aspx!!
then precompile your site so it may reduce first hit user delay!

Use caching option appropriately...

avoid using asp controls .. Use if it is necessary, otherwise opt for HTML controls !!


These are few tips

please refer
http://www.microsoft.com/downloads/details.aspx?FamilyId=8A2E454D-F30E-4E72-B531-75384A0F1C47&displaylang=en



Regards
Renju
0
 
DhaestCommented:
10 Tips for Writing High-Performance Web Applications
http://msdn.microsoft.com/msdnmag/issues/05/01/ASPNETPerformance/
0
 
cmhuntyCommented:
Something to bear in mind.....

Every time you change your web app, the whole app recompiles. It certainly should run quicker after the first view of an altered app.
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
John AccountAuthor Commented:
Thanks, guys. I'm studying the material on the links provided.

cmhunty, yeah, I've noticed it runs quicker after the first view, however, every so often of inactivity it seems like that first view is occuring once again. Thus, if it's not a very popular site, then it's always slow for someone visiting it, as if the first view which is recompiling. Does this make sense?
0
 
John AccountAuthor Commented:
Is this what you're refering to when you mentioned avoiding unnecessay Viewstate Usage, renjurdevan? (taken from http://msdn.microsoft.com/msdnmag/issues/05/01/ASPNETPerformance/ ):

The default behavior of the ViewState property is enabled, but if you don't need it, you can turn it off at the control or page level. Within a control, you simply set the EnableViewState property to false, or you can set it globally within the page using this setting:

<%@ Page EnableViewState="false" %>

If you are not doing postbacks in a page or are always regenerating the controls on a page on each request, you should disable view state at the page level.
0
 
cmhuntyCommented:
Yep. If you have VS2005, you can use the option Build > Publish Web Site. This will compile the DLL there and then so you don't transfer over the code behind pages to the live server. This will mean that it won't recompile itself but you will have to do it every time there is a code change.
0
 
Bob LearnedCommented:
With a 2.0 web site that isn't precompiled, the first time that a page is accessed, and it hasn't been compiled, it will compile the page, which causes the first time to be slower.

Bob
0
 
John AccountAuthor Commented:
cmhunty, is the only thing to do, after Build > Publish Web Site, is upload the .dll files in teh Bin folder?
0
 
cmhuntyCommented:
You should upload the whole app which you've created. I think (can't remember off the top of my head) you specify the output location when you goto publish web site
0
 
John AccountAuthor Commented:
The thing about that, is it uploads every freakkin folder in that root path--which, containing myriad swfs, images, videos, etc--becomes quite huge in size!
0
 
strickddCommented:
I would recommend looking into web deployment projects.

http://weblogs.asp.net/scottgu/archive/2005/11/06/429723.aspx

These will precompile your site and allow you to exclude certain files and folders so that the output is ONLY the code that you need to move out each time (.aspx and .dll's usually).

The next option to look into is caching: http://aspnet.4guysfromrolla.com/articles/022802-1.aspx

Caching can be done on every page or on a page by page basis. You can also cache certain portions of the page like the flash animations. This will decrease load time considerably. Just remember to set a resonable duration if you expect the page to change much.

0
 
John AccountAuthor Commented:
I installed MS Visual Web Developer Express on my dedicated server, to publish directly from there, viah Remote Desktop, so as to not have to upload everything!--but I noticed that MS Visual Web Developer Express does not come with a 'Publish' feature, as cmhunty suggested to use. Is this correct, or are my eyes deceiving me?!
0
 
John AccountAuthor Commented:
So here on my local machine, I created a version of my site just for Publishing purposes, with all excessive folders and files--swfs, videos, etc--and published, then uploaded.  Then I got the following error: "The directory '/App_Code/' is not allowed because the application is precompiled." But then I merely deleted that folder from my remote server, and refreshed the browser, and it worked great! Blazing fast. I restarted the server to compare the difference, and it is in fact 10 times faster than before. Woo hoo...wow, thanks, cmhunty! This publish feature in Visual Studio 2005 is really cool.

Thanks everyone who posted.
0
 
dhaval33Commented:
do not diturbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 6
  • 3
  • 2
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now