Caching data from DB

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
will83
Forum Commoner
Posts: 53
Joined: Thu Nov 10, 2005 3:13 pm

Caching data from DB

Post by will83 »

Hi there.

My site has a dropdown list populated with a list of approx 280 rows from a database.

To increase eprformance on page load times I would like to cache this list so that it is not calling from the database everytime.

Can anyone suggest a method for doing this?

Many thanks!

Will
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

A lot depends on how often the list changes. Can it change during the users "session" ?. If no then store in a session. Is the list the same for all users ? As part of any admin function which edits the options store the full list as a template file to be included. What performance overhead is actually caused and how often is the list created ? With a good select statement and a well designed database/server the impact shouldn't be that great if it is infrequent.
Post Reply