Prosper202 Tracking202 Export202 WorldProxy202 Meetup202 | Blog Forum Newsletter Twitter | Advertise
Login · Register
Home About Docs Scripts Blog Forums Hosting Donate Download

Landing Page Load Time Analysis

With the new qualitly scores taking into account how fast your landing page loads, it is increasingly more important to build faster loading landing pages. And to analyze that we have a simple script, the same one we use on Prosper202.com (see below) that displays at the bottom of each page: how long it took to load. Below is the script that shows how to set this up.

Landing Page Code

<? $microtimer microtime();  /*set the timer, this is to be placed at the top! */  ?>

<html>
    <head>
        <title>Title</title>
    </head>
    <body>
    
        Blah Blah Blah, this is my content!
        
        <? //print on the screen how long this page to took to load
        
$seconds =  microtime() - $microtimer;
        echo 
'This page took ' round($seconds,3) . ' seconds to load.'?>
    
    </body>
</html> 

Conclusion

So now at the bottom of each page it will say: This page took xxxxx seconds to load.

Responses

  1. Craig Mullins on Oct 28, 2008 at 12:52am

    Now we just need to set up a mysql database for logging various times of the day & to see how fast it loads for people in other areas

  2. Wes (MasterlessSamurai,cin on Nov 24, 2008 at 12:28pm

    question...

    does this have to be above the opening HTML elements or is there another way we could use it? I read this article about IE6 breaking when anything is on the first line before the doctype declaration.

    [url=http://www.communitymx.com/content/article.cfm?page=2&cid=E2F258C46D285FEE]http://www.communitymx.com/content/article.cfm?page=2&cid=E2F258C46D285FEE[/url]

    i verified...my page doesnt fully validate when i have this code.

  3. Wes (MasterlessSamurai.com) on Nov 24, 2008 at 12:28pm

    question...

    does this have to be above the opening HTML elements or is there another way we could use it? I read this article about IE6 breaking when anything is on the first line before the doctype declaration.

    [url=http://www.communitymx.com/content/article.cfm?page=2&cid=E2F258C46D285FEE]http://www.communitymx.com/content/article.cfm?page=2&cid=E2F258C46D285FEE[/url]

    i verified...my page doesnt fully validate when i have this code.

  4. Wes Mahler on Nov 24, 2008 at 9:55pm

    It is PHP code, it is displayed above the HTML, it won't break, because the PHP code isn't rendered.

Leave a Reply

Name (required)

Email (will not be published) (required)

Website

What does 4 + 4 equal? (required spam filter)


Creative Commons License This work (Prosper202, Tracking202 and Export202) is licensed under a
Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.