"Beyond Performance" tools

In order to get a better idea of how to implement these types of solutions, we will create an animated transition that will wrap itself around a very slow PHP script. Thus, we will try to influence the perceived speed of the original script.

Our original PHP script will simulate slow execution by running a sleep command. Here is the content of the original script:

<?php// chap10_slow_before.phpsleep(5);echo 'The original page loads very slowly...';

If we run this script immediately, we definitely perceive that the script is slow and that the elapsed time could make us believe that something is going wrong:

The script's ...

Get Mastering The Faster Web with PHP, MySQL, and JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.