Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Speeding up an ASP.Net Web Site or Application

Tags:

I have an Ajax.Net enabled ASP.Net 2.0 web site. Hosting for both the site and the database are out of my control as is the database's schema. In testing on hardware I do control the site performs well however on the client's hardware, there are noticeable delays when reloading or changing pages.

What I would like to do is make my application as compact and speedy as possible when I deliver it. One idea is to set expiration dates for all of the site's static resources so they aren't recalled on page loads. By resources I mean images, linked style sheets and JavaScript source files. Is there an easy way to do this?

What other ways are there to optimize a .Net web site?

UPDATE: I've run YSlow on the site and the areas where I am getting hit the hardest are in the number of JavaScript and Style Sheets being loaded (23 JS files and 5 style sheets). All but one (the main style sheet) has been inserted by Ajax.net and Asp. Why so many?

like image 278
Rob Allen Avatar asked Aug 14 '08 18:08

Rob Allen


People also ask

Why is my ASP.NET web application so slow?

There can be numerous reasons why . NET applications can be slow. These include incorrect memory sizing, GC pauses, code-level errors, excessive logging of exceptions, high usage of synchronized blocks, IIS server bottlenecks, and so on.


2 Answers

  1. Script Combining in .net 3.5 SP1
  2. Best Practices for fast websites
  3. HTTP Compression (gzip)
  4. Compress JS / CSS (different than http compression, minify javascript)
    1. YUI Compressor
    2. .NET YUI Compressor

My best advice is to check out the YUI content. They have some great articles that talk about things like CSS sprites and have some nice javascript libraries to help reduce the number of requests the browser is making.

like image 71
Darren Kopp Avatar answered Oct 20 '22 06:10

Darren Kopp


If you are using Firefox to test your website, you might want to try a nifty Firefox extension from Yahoo! called YSlow.

It analyzes your web pages and provides grades from A-F (A being the Best and F being the worst) for each of the best practices, for high performance websites. It will help you to track down the elements of your website which you could optimize to gain speedups.

UPDATE

Now YSlow extension is compatible with all modern browsers such as Firefox, Chrome, Opera, Safari and others, read more here.

like image 38
Pascal Avatar answered Oct 20 '22 06:10

Pascal