optimilize web page loading

This is a discussion on optimilize web page loading within the PHP General forums, part of the PHP Programming Forums category; Hi, i would like to know if there is a way to know how long does a web page need ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-26-2008
Alain Roger
 
Posts: n/a
Default 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

Reply With Quote
  #2 (permalink)  
Old 03-26-2008
Paul Scott
 
Posts: n/a
Default Re: [PHP] optimilize web page loading


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/p...disclaimer.htm

Reply With Quote
  #3 (permalink)  
Old 03-26-2008
Aschwin Wesselius
 
Posts: n/a
Default Re: [PHP] optimilize web page loading

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....'/

Reply With Quote
  #4 (permalink)  
Old 03-26-2008
dhorton@iprimus.com.au
 
Posts: n/a
Default RE: [PHP] optimilize web page loading

Get hold of
Steve Souders: "High Performance Web Sites: 14 Rules for Faster Pages"
http://www.oreilly.com/catalog/97805...x.html#details

There is a video at
http://www.oreillynet.com/fyi/blog/2...rformance.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" <raf.news@gmail.com>
>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


Reply With Quote
  #5 (permalink)  
Old 03-26-2008
Richard Lynch
 
Posts: n/a
Default Re: [PHP] optimilize web page loading

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?

Reply With Quote
  #6 (permalink)  
Old 03-26-2008
Philip Thompson
 
Posts: n/a
Default Re: [PHP] optimilize web page loading

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
Reply With Quote
  #7 (permalink)  
Old 03-26-2008
Al
 
Posts: n/a
Default Re: optimilize web page loading

You are really asking an HTML question, if you think about it.

At the PHP level, either use output buffering or assemble all your html string as a variable and
then echo it. The goal is to compress the string into the minimum number of packets.

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 ?
>

Reply With Quote
  #8 (permalink)  
Old 03-26-2008
Andrew Ballard
 
Posts: n/a
Default Re: [PHP] Re: optimilize web page loading

On Wed, Mar 26, 2008 at 1:18 PM, Al <news@ridersite.org> wrote:
> You are really asking an HTML question, if you think about it.
>
> At the PHP level, either use output buffering or assemble all your html string as a variable and
> then echo it. The goal is to compress the string into the minimum number of packets.


Yes, but do so smartly. Excessive string concatenation can slow things
down as well. On most pages you probably won't notice much difference,
but I have seen instances where the difference was painfully obvious.

Andrew
Reply With Quote
  #9 (permalink)  
Old 03-27-2008
Al
 
Posts: n/a
Default Re: [PHP] Re: optimilize web page loading

Depends on the server and it's load. I've strung together some rather large html strings and they
aways take far less time than the transient time on the internet. I used to use OB extensively until
one day I took the time to measure the difference. I don't recall the numbers; but, I do recall it
was not worth the slight extra trouble to use OB.

Now, I simple assemble by html strings with $report .= "foo"; And then echo $report at the end. It
also makes the code very easy to read and follow.

Andrew Ballard wrote:
> On Wed, Mar 26, 2008 at 1:18 PM, Al <news@ridersite.org> wrote:
>> You are really asking an HTML question, if you think about it.
>>
>> At the PHP level, either use output buffering or assemble all your html string as a variable and
>> then echo it. The goal is to compress the string into the minimum number of packets.

>
> Yes, but do so smartly. Excessive string concatenation can slow things
> down as well. On most pages you probably won't notice much difference,
> but I have seen instances where the difference was painfully obvious.
>
> Andrew

Reply With Quote
  #10 (permalink)  
Old 03-27-2008
AlmostBob
 
Posts: n/a
Default Re: [PHP] Re: optimilize web page loading

http://www.websiteoptimization.com/s...yze/index.html

http compression, content encoding using gzip

--
If at first you dont succeed
try try try again
If at first you do succeed
try not to look surprised

_
"Al" <news@ridersite.org> wrote in message
news:6F.07.47041.31CDAE74@pb1.pair.com...
> Depends on the server and it's load. I've strung together some rather

large html strings and they
> aways take far less time than the transient time on the internet. I used

to use OB extensively until
> one day I took the time to measure the difference. I don't recall the

numbers; but, I do recall it
> was not worth the slight extra trouble to use OB.
>
> Now, I simple assemble by html strings with $report .= "foo"; And then

echo $report at the end. It
> also makes the code very easy to read and follow.
>
> Andrew Ballard wrote:
> > On Wed, Mar 26, 2008 at 1:18 PM, Al <news@ridersite.org> wrote:
> >> You are really asking an HTML question, if you think about it.
> >>
> >> At the PHP level, either use output buffering or assemble all your

html string as a variable and
> >> then echo it. The goal is to compress the string into the minimum

number of packets.
> >
> > Yes, but do so smartly. Excessive string concatenation can slow things
> > down as well. On most pages you probably won't notice much difference,
> > but I have seen instances where the difference was painfully obvious.
> >
> > Andrew



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:25 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0