"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.php sleep(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 slow execution might make us believe that something is going wrong
The script truly gives us the impression that it is momentarily hanging.
We will now create an HTML script that will query the original PHP script and obtain the script's output through an AJAX request. This new HTML script will also add some transition animations in order to influence...