First off... Sending plain HTML is always going to be
faster than processing database records.
If the information really doesn't change that often,
why don't you just generate an HTML page and feed that
to the visitors?
You could check the generation date/time of the HTML
file and regenerate from the database if the generation
date/time is older than some defined value.
{ You could even use matches in an .htaccess file to do
the caching check and either feed a pre-generated HMTL
file or invoke the index.php script if generation is required. }
Just a thought...
Some pseudo code for checking inside of an index.php file...
-
0- Entry point of index.php
-
-
1- Check file time of index.html
-
-
2- If time is within the defined caching time,
-
feed the current index.html to the browser.
-
-
3- If time is older, regenerate the index.html using
-
buffering, output to the browser, and overwrite the index.html file
-
(Ensuring that only one visitor's request is overwriting
-
the HTML file can be a little tricky and would more than
-
likely require some type of semaphore or temp file to
-
real file switch, but it's doable.)
-