Do optimize your web application!
Some couple of weeks ago, I have written about rolling your own content management system. The idea behind the reason was about keeping your code optimized for serving a couple of thousands of visitors.
Now, I would like to add more information on web site optimization in terms of server-side coding.
In many server-side coding tutorials, I see that people use server side coding like this:
<html>
bla bla
<div> bla bla <?php echo $blabla; ?></div>
<div><h1><?php echo $footitle; ?></h1>
<p>bla <?php echo $bla; ?> bla</p>
</html>
Now, this might be headache for your server, once traffic increases.
Because in this sample, the PHP processor will com into the stage for many times.
Instead of knocking the door of PHP processor many times, you can also handle this like this:
$page = “<html>
bla bla
<div> bla bla $blabla </div>
<div><h1>$footitle</h1>
<p>bla $bla bla</p>
</html>“;
echo $page;
You are all set now. Your server will do just one PHP processing and then send the page to the client. And you will see performance changes on huge load.
Happy coding.


