[PHP] optimilize web page loading

2008-03-26 Thread Alain Roger
Hi,

i would like to know if there is a way to know how long does a web page need
to be loaded into browser ?
this is interesting fact for me, as i will optimilize my PHP code in order
to reduce this time to minimum.

i was thinking to use some timestamp but as it will be in PHP, it mean that
it should take time from server and therefore it is not fully representative
from client browser time needed to load page :-(
purpose :
mywebpage.php - 23 s before optimalization
mywebpage.php - 12 s after optimalization

do you have any idea ?

-- 
Alain

Windows XP SP2
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008


Re: [PHP] optimilize web page loading

2008-03-26 Thread Paul Scott

On Wed, 2008-03-26 at 09:25 +0100, Alain Roger wrote:
 i would like to know if there is a way to know how long does a web page need
 to be loaded into browser ?
 this is interesting fact for me, as i will optimilize my PHP code in order
 to reduce this time to minimum.

Try using microtime() http://www.php.net/microtime/ on either side of
your output statement(s).

--Paul
 
-- 
.
| Chisimba PHP5 Framework - http://avoir.uwc.ac.za   |
::

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] optimilize web page loading

2008-03-26 Thread Aschwin Wesselius

Alain Roger wrote:

Hi,

i would like to know if there is a way to know how long does a web page need
to be loaded into browser ?
this is interesting fact for me, as i will optimilize my PHP code in order
to reduce this time to minimum.

i was thinking to use some timestamp but as it will be in PHP, it mean that
it should take time from server and therefore it is not fully representative
from client browser time needed to load page :-(
purpose :
mywebpage.php - 23 s before optimalization
mywebpage.php - 12 s after optimalization

do you have any idea ?


Hi,

If you make use of Firefox, you can use the Yslow extension. This will 
show you the bottlenecks of the page loaded (images, stylesheets, 
javascripts, total duration, total size etc.).

--

Aschwin Wesselius

/'What you would like to be done to you, do that to the other'/


RE: [PHP] optimilize web page loading

2008-03-26 Thread dhorton
Get hold of 
Steve Souders: High Performance Web Sites: 14 Rules for Faster Pages
http://www.oreilly.com/catalog/9780596529307/index.html#details 

There is a video at
http://www.oreillynet.com/fyi/blog/2007/09/steve_souders_high_performance.html

Browse the links from which you can see what he is suggesting without getting
the book.

Some of the things suggested are 
- minimise number of files (css, js) downloaded by concatenating
- add an expires header so pages come from browser cache instead of download
- put style sheets at the top of downloaded page and (js) scripts to bottom

Someone else mentioned Yslow, which is one of the tools the author suggests.

David

-- Original Message --
Date: Wed, 26 Mar 2008 09:25:46 +0100
From: Alain Roger [EMAIL PROTECTED]
To: PHP General List php-general@lists.php.net
Subject: [PHP] optimilize web page loading


Hi,

i would like to know if there is a way to know how long does a web page
need
to be loaded into browser ?
this is interesting fact for me, as i will optimilize my PHP code in order
to reduce this time to minimum.

i was thinking to use some timestamp but as it will be in PHP, it mean that
it should take time from server and therefore it is not fully representative
from client browser time needed to load page :-(
purpose :
mywebpage.php - 23 s before optimalization
mywebpage.php - 12 s after optimalization

do you have any idea ?

-- 
Alain

Windows XP SP2
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] optimilize web page loading

2008-03-26 Thread Philip Thompson

On Mar 26, 2008, at 3:40 AM, Aschwin Wesselius wrote:

Alain Roger wrote:

Hi,

i would like to know if there is a way to know how long does a web  
page need

to be loaded into browser ?
this is interesting fact for me, as i will optimilize my PHP code  
in order

to reduce this time to minimum.

i was thinking to use some timestamp but as it will be in PHP, it  
mean that
it should take time from server and therefore it is not fully  
representative

from client browser time needed to load page :-(
purpose :
mywebpage.php - 23 s before optimalization
mywebpage.php - 12 s after optimalization

do you have any idea ?


Hi,

If you make use of Firefox, you can use the Yslow extension. This  
will show you the bottlenecks of the page loaded (images,  
stylesheets, javascripts, total duration, total size etc.).

--

Aschwin Wesselius



Firebug for Firefox.

~Philip

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] optimilize web page loading

2008-03-26 Thread Richard Lynch
You can use onload and XmlHttpRequest to send back the desktop client
computer date/time and compare that with your start time.

Note that you'll need to test on [a] computer[s] where you know the
date/time is set correctly, which is not true of the general visitor.

On Wed, March 26, 2008 3:25 am, Alain Roger wrote:
 Hi,

 i would like to know if there is a way to know how long does a web
 page need
 to be loaded into browser ?
 this is interesting fact for me, as i will optimilize my PHP code in
 order
 to reduce this time to minimum.

 i was thinking to use some timestamp but as it will be in PHP, it mean
 that
 it should take time from server and therefore it is not fully
 representative
 from client browser time needed to load page :-(
 purpose :
 mywebpage.php - 23 s before optimalization
 mywebpage.php - 12 s after optimalization

 do you have any idea ?

 --
 Alain
 
 Windows XP SP2
 PostgreSQL 8.2.4 / MS SQL server 2005
 Apache 2.2.4
 PHP 5.2.4
 C# 2005-2008



-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] optimilize web page loading

2008-03-26 Thread Wolf

 Alain Roger [EMAIL PROTECTED] wrote: 
 Hi,
 
 i would like to know if there is a way to know how long does a web page need
 to be loaded into browser ?
 this is interesting fact for me, as i will optimilize my PHP code in order
 to reduce this time to minimum.
 
 i was thinking to use some timestamp but as it will be in PHP, it mean that
 it should take time from server and therefore it is not fully representative
 from client browser time needed to load page :-(
 purpose :
 mywebpage.php - 23 s before optimalization
 mywebpage.php - 12 s after optimalization
 
 do you have any idea ?

General rule of thumb used to be 2 seconds...  If your page hasn't outputted 
some form of usable information in 2 seconds or less, people don't stick around.

What's worse is that some browsers require the whole page contents before they 
will draw the page, so you get a white page while the page is loading into the 
browser and the client gets nothing.

Firebug/Yslow are both good extensions to load for Firefox to see where the 
bottlenecks are.

Wolf

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php