Question

I have several informations stored in my database, which will not change when the site got refreshed. For example the main homepage settings:

  • Title of the page
  • Homeurl
  • PayPal address
  • E-Mail address
  • etc.

I have a class called "Homepage" and this class always queries the db to get these informations. Now I want to cache these things, so that I only have to query one time this informations. Should I use a flat json file, which stores this informations for me and others? or should I use the PHP function apc_store? Or is there another good resolution for my problem? Is it possible to cache my PHP PDO class?

Thanks for your help

Was it helpful?

Solution

There are several options. You could use flat file storage but most caching methods are faster than reading from the disk.

Have a look at these to name a few:

You could even use a noSQL database such as MongoDB as a caching layer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top