Asp.net WebSite Performance
You can boost performance of web application by reducing round trips from client to web server and web server to database server.
Here are some tips that will help you.
1. HttpResponse.IsClientConnected.
This property will tell server whether client is still connected to the server or not. If it is still connected you can process the request to perform operations on it.
2. Caching
If you are fetching the data which is almost static, you can consider use of caching. So, when next user request the data he will get it from CACHE.
3. Server.Transfer
Where ever possible use Server.Transfer instead of Response.Redirect. If you had used Response.Redirect in your code, client gets redircted page address in header
with status code 302 then ceint request the url found in header.
4. View state
Avoid storing state of object in view state. During post back you will post unnecessory data in hiddenField called __VIEWSTATE.
5. WEB.Config
If you are not using Session module, you can remove it by overrriding default behaviour maching.config using web.config.
same way you can disable out put caching, authentication and authorization mechanisems.
6. Web Gardening
Add multiple worker process in Application pool. This will boost the performance of your application.
Adding multiple worker proccess to your application pool will consume more memory.
Note: If your application is using session, you need to store the session out of process. You can use SQL server or State server.
This will help worker process to access shared session values across the worker process.
7. Web Farmng
Create multiple instances of your web application on multiple machines and bring those machines into NLB cluster (Network load balancer)
It will increas availability of your web application.
8. Exceptions
Avoid exceptions to occur.
9. Ensure Debug Is Set to False
When debug is set to true, following occurs
Pages do not time out.
Additional files are generated in the Temporary ASP.NET Files folder. which creates extra I/O operations.
make debug false in both web.config and at page level
<compilation debug="false" ... />
<%@ Page debug="false" ... %>
10. Optimize Expensive Loops
Use For loop instead of ForEach loop when performance is important for the operation.
11. Server Controls
Turn off ViewState properties of server side control if not required.
avoid creating deep hirarchies of controls
use server controls whenever required else use html controls.
12. Data Binding
if it is inefficiently used will hit performance measures.
Avoid Page.DataBind instead use control specific DataBind method
Avoid performing DataBinder.Eval operations of controls.
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5