Page is a not externally linkable
- Code, Content, and Presentation
-- Databases
---- improving speed of mysql driven websites


whoisgregg - 1:20 pm on Jul 1, 2010 (gmt 0)


Basically, you can do something like this to cache your navigation for 24 hours at a time:

$path_to_cache = './navigation.html';
if(file_exists($path_to_cache) && filemtime($path_to_cache) > strtotime("-24 hours")){
include($path_to_cache);
} else {
// query MySQL
// generate navigation HTML
file_put_contents($path_to_cache, $nav_html);
echo $nav_html;
}


Thread source:: http://www.webmasterworld.com/databases_sql_mysql/4161747.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com