I'm working on a webpage where I've laid out the index page as:
.
... INSERT LAYOUT SPECIFIC CONTENT
.
<?
// here's the actual user-content
switch($action) {
default:
include 'intro.php';
break;
case "xyz":
include 'xyz.php';
break;
.
.
}
?>
.
.
I've done it this way so that I can keep a consistent layout and ease maintenance by just including in the content in a layout-free form. Each of the sub-pages may or may not contain switches as well, adding a bit of versatility.
A problem is that load times are excessively long, especially with long files. Is this a result of the interpretive (and not compiled) nature of PHP? Would things improve if I compiled the code? Or is this approach just inefficient to begin with?
I have another site that I did a similar thing with and it was no way near as slow as it is now. I can't explain why, other than the fact that on BOTH of the computers where the pages are slow, I'm using Apache or IIS on NT/2000 platforms, where as the fast pages are delivered from a RedHat box. I guess another question then would be, is the PHP engine that much faster under Linux?
Thanks!
Danny