I have a few questions about speeding up PHP, if I'm doing things the "fastest way".
I've set up a template for our Web site that includes a header and a footer. To do that I use a require_once(). I do that so the people filling in the body can't mess up the design. Another reason for that is so I can create a printer friendly page. This is done through a bunch of if else statements. I have arount 8 statements per page. The condition is based on the $SERVER['QUERY_STRING'] variable. Is there anyway to speed that up? I think I have as few if statements as possible. An example of one is:
<?php if ($_SERVER['QUERY_STRING'] == "Print" || $_SERVER['QUERY_STRING'] == "PrintAdmin" || $_SERVER['QUERY_STRING'] == "PrintAdminWO"): ?>
Print This HTML
<?php else: ?>
Print This HTML
<?php endif; ?>
Another thing that realy slows it down is the readfile(). I use this to include information from our YaBB forum so it needs to be phrased before inluding it. So, inclued and require didn't work. The code for this is:
<?php readfile("http://www.stma.k12.mn.us/forum/YaBB.pl?action=includecal"); ?>
This realy slows the page down. The thing I don't like about it is that it makes a http request, just putting in the full path didn't work. Does anyone know of a better way to do this?
Lastly, I would like to cache the main pages. How is this done? The main page is hit alot and I think it is phrased for every request. It would be nice if it was cached.
If anyone has any ideas for this stuff that would be great!
Thanks