开发者

Increase the performace of a web page

开发者 https://www.devze.com 2023-03-08 23:37 出处:网络
I have a shopping portal website which has filtering criteria for the products.开发者_如何学C Webpage is structured into 2 vertical frame

I have a shopping portal website which has filtering criteria for the products.开发者_如何学C

Webpage is structured into 2 vertical frame

 Search Criteria    | Product list {with pictures}

I have seacrh criteria like "Color", "Size", "Brand", "Product version" etc..

It works fine when I select the criteria in the left panel and it shows the filtered result on the right panel beacause it then show few number of products.

but when I select no filter criterial [i.e. show all] than due to large number of product [almost 10,000] my product loading takes 2 minutes to load.

How could I improve the processing of product loading?

I am fetching only four details from the database [1: product name, 2: product image [which is nothing but a URL] 3: prouct price 4: Product Id]


You should not display 10k records on a page. Not even 100. You need to page the results using stored procedures. The stored procedure will take page number and page size as input and would only return the records that are displayed on the current page.

10 Tips for Writing High-Performance Web Applications - Tip #2 is about paged data access.

Edit: You can use object data source for paging the datalist.
Efficient Data Paging with the ASP.NET 2.0 DataList Control and ObjectDataSource


It makes usually no sense to display 10000 items on a web page. Implement paging and your problem is probably solved. Beside that, your querying and reading code might be bad. But without seeing the code it's hard to say something about that.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号