Performance Issue

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
pcoder
Forum Contributor
Posts: 230
Joined: Fri Nov 03, 2006 5:19 am

Performance Issue

Post by pcoder »

Hi All,
I have divided the whole page into different sections: Header, Content and the Footer.
In every pages, I have included the Header part and the Footer, it's a simple logic.
Now, the problem is in menu part, which I pull from the database and populates data into the Header part.
Every time, when the page loads, it has the Header section,It means it calls the database and populates the menu data.
I have used the MVC pattern. How can I cache the whole Header section, specially the menu data?
I am looking for the best way to cache it.
davegmpd
Forum Newbie
Posts: 14
Joined: Tue Oct 27, 2009 9:42 am
Location: London

Re: Performance Issue

Post by davegmpd »

There are many ways!

You could simple write the "cached" header to a file and then read and output. Or you could use something like memcache I guess.

Things like Smarty template engine will do stuff like this for you.

Dave
Post Reply