Why page is slow?
-
I have created a page that stores a DataSet in a session variable and remove the session variable once the user navigates away from it. There are about 5 grids each with about 4 columns and 3-4 rows and two Developer Express comboboxes which I could see from the view source writing a lot of scripts. I have them all put inside an update panel. The problem is the page is taking too much time b/w postbacks(async). The yslow shows the following in F grade: -Make Fewer HTTP requests -Use a content Delivery Network -Add Expires headers -Minify Javascript and CSS -Configure entity tags. These two D grades: -Minify Javascript and CSS -Configure entity tags. This one in E grade: -Reduce the number of DOM elements. My browser is IE 7. To my surprise the page is pretty faster in the latest version of FireFox.
-
I have created a page that stores a DataSet in a session variable and remove the session variable once the user navigates away from it. There are about 5 grids each with about 4 columns and 3-4 rows and two Developer Express comboboxes which I could see from the view source writing a lot of scripts. I have them all put inside an update panel. The problem is the page is taking too much time b/w postbacks(async). The yslow shows the following in F grade: -Make Fewer HTTP requests -Use a content Delivery Network -Add Expires headers -Minify Javascript and CSS -Configure entity tags. These two D grades: -Minify Javascript and CSS -Configure entity tags. This one in E grade: -Reduce the number of DOM elements. My browser is IE 7. To my surprise the page is pretty faster in the latest version of FireFox.
tonymathewt wrote:
I have created a page that stores a DataSet in a session variable and remove the session variable once the user navigates away from it.
Sounds dumb to me.
tonymathewt wrote:
To my surprise the page is pretty faster in the latest version of FireFox.
No surprises there. I would check to see how long your database calls take, I would check to see how the update panel performs ( fast AJAX means writing your own code, the ASP.NET library is far from efficient ), and I'd check to see what I was databinding if I don't need to. I'd also check viewstate size to see if I'm posting a massive page every time. You could have the data from your dataset in viewstate, and have it stored in the session as well. \
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
I have created a page that stores a DataSet in a session variable and remove the session variable once the user navigates away from it. There are about 5 grids each with about 4 columns and 3-4 rows and two Developer Express comboboxes which I could see from the view source writing a lot of scripts. I have them all put inside an update panel. The problem is the page is taking too much time b/w postbacks(async). The yslow shows the following in F grade: -Make Fewer HTTP requests -Use a content Delivery Network -Add Expires headers -Minify Javascript and CSS -Configure entity tags. These two D grades: -Minify Javascript and CSS -Configure entity tags. This one in E grade: -Reduce the number of DOM elements. My browser is IE 7. To my surprise the page is pretty faster in the latest version of FireFox.
Yes there are lots of things that improves performance of your page. Writing Dataset to Session variable is really not good. Remove viewState by using EnableViewState ="false" if you are not using it. this would reduce the page size by a lot. Minify javascript means removing whitespaces from javascript. I always use minified javascript for requests. And if possible, apply a cache header to the CSS and JS files. Reduce the number of DOM elements means reducing large no of hiddenfield, Tables, Divs, etc. Just reduce them and apply CSS to position it perfectly. You might use Compress-Response-and-HTML-WhiteSpace-Remover[^] to compress your page. By this way you need to create others. :cool:
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Simplify Code Using NDepend
Basics of Bing Search API using .NET
Microsoft Bing MAP using Javascript -
tonymathewt wrote:
I have created a page that stores a DataSet in a session variable and remove the session variable once the user navigates away from it.
Sounds dumb to me.
tonymathewt wrote:
To my surprise the page is pretty faster in the latest version of FireFox.
No surprises there. I would check to see how long your database calls take, I would check to see how the update panel performs ( fast AJAX means writing your own code, the ASP.NET library is far from efficient ), and I'd check to see what I was databinding if I don't need to. I'd also check viewstate size to see if I'm posting a massive page every time. You could have the data from your dataset in viewstate, and have it stored in the session as well. \
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
Thank you Christian I am actually updating the dataset to the Data base before removing (trying to reduce the Database hits). Updates are done directly on this dataset and then used for adaptor.update(). The dataset is kept in a session variable b/w postbacks. Do you find anything wrong with this approach?
-
Yes there are lots of things that improves performance of your page. Writing Dataset to Session variable is really not good. Remove viewState by using EnableViewState ="false" if you are not using it. this would reduce the page size by a lot. Minify javascript means removing whitespaces from javascript. I always use minified javascript for requests. And if possible, apply a cache header to the CSS and JS files. Reduce the number of DOM elements means reducing large no of hiddenfield, Tables, Divs, etc. Just reduce them and apply CSS to position it perfectly. You might use Compress-Response-and-HTML-WhiteSpace-Remover[^] to compress your page. By this way you need to create others. :cool:
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Simplify Code Using NDepend
Basics of Bing Search API using .NET
Microsoft Bing MAP using JavascriptAbhishek, I need to reduce DataBase hits that's why I am keeeping the DataSet in Session variable.
Abhishek Sur wrote:
Remove viewState by using EnableViewState ="false" if you are not using it.
Do you mean to set this property for each control?