Friday, July 18, 2008

Improve Web Application Performance

Introduction

In the IT world, software applications are being rapidly developed. Clients, and so employers, are just looking for those teams/individuals who can build up applications rapidly, just bothering to make their application live; but what often happens after an application goes live is that users start to use the application and it doesn’t respond well. At this point, clients start to lose users and business.To code an application is not a big deal; I believe it can be done by virtually anyone, meaning it is not necessary to have great knowledge or experience. Improving performance of an existing application (especially an one put together rapidly) could be quite risky and could cause many ripple effects. Things must be planned first to avoid horrible results.The following are a few points that can make a site scalable and reliable; but which may initially slow down development. I believe that overall, when maintenance and future changes are taken into account, total development time would be reduced.

1. Minimize HTTP based Requests
2. HTTP Compression:
3. Correct Formatted Images at the Right Place:
4. Compress CSS, JavaScript and Images
5. CSS at Top
6. Javascript at Bottom
7. Content Delivery Network: (CDN)
8. Ajax
9. Ajax vs. Callback
10. Reduce Cookie size
11. Use Cache appropriately
12. Upload compiled code rather than source code

Following are few good practices to gain better performance:

  • For HTTP compression, GZip is considered the most effective and most popular by means of browsers and HTTP server. It can reduce file size up to 70% in size.
  • Always keep JavaScript and CSS in external files.
  • Avoid redirects until needed. Server.Transfer is also provided so consider that as well since it performs better in some conditions.
  • Minimize use of Iframes as it's costly.
  • Avoid try-catch blocks for control-flow as they perform poorly. Exceptions should be used only in truly exceptional situations.
  • Minimize Cookie/CSS sizes.
  • Minimize DOM objects on page as they are heavy weight.
  • Use link tags rather than @import to use/link up CSS.
  • Favicon, being a static image displayed in the browser’s address bar, should be cacheable and compressed.
  • Always prefer a cache-friendly folder structure. For example, create specific folders for static contents, like /static for static images/static pages.
  • SSL can never be cached so minimize its usage. Keep it for those pages which need to be secure, rather than using it for all the pages.
  • HTTP Post requests can’t be cached, so choose the HTTP method appropriately.
  • Prevent Denial of Service (Dos) attacks.
  • Prevent SQL Injection.
  • Prevent Cross Site Scripting (XSS).

Read the full article by dr.honey (IT SURGEON) at the following link: http://developerscon.blogspot.com/2008/06/improve-web-application-performance.html

No comments:

Shared Cache - .Net Caching made easy

All information about Shared Cache is available here: http://www.sharedcache.com/. Its free and easy to use, we provide all sources at codeplex.

Facebook Badge