Hi, I have a file incl_leftmenu.php which i include on every page. It's the same on each page. But the query results in that file do not change very often. The problem is that each time a new page is loaded, all queries in incl_leftmenu.php are executed, which i think slows down load time alot. Are there any solutions for this ? Like re-load the left menu only every 15 minutes or so ? Thank you Fat Abbot
You could use a cache mechanism like MMCache or APC to reduce server load. A really simple thing could be setting up a cron that executes incl_leftmenu every X minutes and store the output/result as plain html file and include that file instead (just an idea).
OR save the data in the global $_SESSION var. If the $_SESSION doesn't exist load the data from the db, otherwise just pull it from the session. This is nice because each user will have a "fresh" copy of whats suppose to be their when they load the page, and they will hold onto that until the session expires or they close the browser window. Custom cash mechanism