Wednesday, August 25, 2010

Improving ASP.NET website Performance


(1)

Decrease image size in various ways using reducing resolution, high compress rate or lower image quality.
(2) Use image path as simply replace it with static image link like this “/img/expand.gif”.
(3) Ajax.net framework – Use more JavaScript files via ScriptManager, Instead of adding entire js file only include the js files that is necessary to your application.
(4) CSS should be created, instead of applying individual control’s style.
(5) Keep entire CSS in separate files as per your page, so it will catch only that css file which is required.
(6) Duplicated or near to similar definition- Instead of repeating more than one function that behave near to similar functionality the only difference between them are Source ControlID. So, merge those all lengthy instances into one simple function and merge them together. That would be really simple way to reduce page size.
(7) Very deep server side controls hierarchy and very lengthy ID and Name strings, keep your parent control’s ID shorter So control ID does affect your page size a lot, especially the controls at the top level!.
· Make your hierarchy “flat”. Do you introduce container controls (such as Panel, server side DIV, etc) into your control hierarchy if not really necessary.
· Make your control’s ID shorter, so when HTML generated it’s page size become small.
(8) Cache header should be properly configured. There are lots of static resource files do not have proper caching header settings setup your expiration header to avoid this kind of unnecessary round trip to server! This is simply an IIS configuration change.
(9) Gzip/Deflate compression needs to be turned on.
(10) Make your Ajax call more efficient and keep ViewState size in control.
(11) Reduce ViewState size at any cost!!!
· Disable control’s ViewState one by one, make sure your app is still functioning though.
· Keep your control hierarchy “flat” and keep your ID short, as described above because controls ID will be part of the ViewState string in an encrypted way.
· Replace your server side controls with simple pure HTML tags, if possible. No server side controls if not needed. The fewer server side controls you use, the shorter the ViewState is in general.
(12) Use WebMethod to avoid page refresh.
(13) Use client site validation as much as possible instead of server site validation.


==============================================
Hiren Raval|Senior Software Engineer

WebMingle Technology
Accelerated by knowledge. Driven by values.
www.webMingle.in

No comments:

Post a Comment