Optimize Website

T

TCB

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.

TIA!
 
W

Wiktor Zychla [C# MVP]

U¿ytkownik "TCB said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top