Re: Optimize Website
- From: "Wiktor Zychla [C# MVP]" <wzychla_ii.uni.wroc.pl>
- Date: Mon, 19 Dec 2005 21:03:16 +0100
U¿ytkownik "TCB" <tcordonb@xxxxxxxxxxx> napisa³ w wiadomo¶ci
news:OkOCjGMBGHA.1032@xxxxxxxxxxxxxxxxxxxxxxx
>I am developing a website using .NET 2.0 (classified style website) it
>displays a series of records per page (8, using a datagrid with paging)
>each record displays a thumbnail of an image that sizes about 6-7k and a
>small text description of the item. The Items tamble holds now about 2500
>hundred records so that´s 60+ pages. The thing is that all the page when it
>load is about 175K. Of those 83K are from images the rest is the text that
>makes the HTM file. It feels like the page loads verry slow (about 20 sec
>in y 768 kbps internet access) so for the size of the page i guess it is
>not the html and images what is making this load so slow but some of the
>calls I make to de DB. What can be causing this, the main call i make to
>the DB is to get the list of records but the response time is verry slow
>compared with a prev version of the same website i have that uses .NET 1.1
>
> How can I cache some of the images that make up the page, this images are
> repetitive in al the results pages.
>
> The DB access is exactly the same as in the prev version that works much
> faster that this, lstAds_PageIndexChanged calls a DataBind() sub that DOES
> get the entire recordset.
I suggest you turn on tracing, add few custom messages here and there and
see what causes your code to execute too slowly.
>From what you say I conclude that the main problem could be the DataBind
call that gets entire resorset each time. If you think of a scalable
application, use custom paging instead. As fas as I know the only way you
get custom paging in 2.0 is to use ObjectDataSource (the old custom paging
model is gone, I wonder why?).
However, there is still the problem of writing smart SQL queries that get
exactly required records. If you need the idea, look at the link below. The
idea is to create a temp table and select records from it - this is still
much faster than copying whole recordset from database server to an
application server.
http://www.dotnetjunkies.com/Article/975BE770-E5DC-4610-870B-A82BDB9B8845.dcik
I hope this helps you,
Wiktor Zychla
.
- References:
- Optimize Website
- From: TCB
- Optimize Website
- Prev by Date: Fragile
- Next by Date: More than One
- Previous by thread: Optimize Website
- Next by thread: TCPClient App Question
- Index(es):
Relevant Pages
|