CodeIgniter Forums
How best to cache setting details - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: How best to cache setting details (/showthread.php?tid=5091)



How best to cache setting details - El Forum - 01-05-2008

[eluser]adamp1[/eluser]
I have my own settings module which is used to pull settings from a DB table and provide them for use throughout my projects. Now it has a cache option where on each load of the class it, loads EVERY setting into an array. Now this does mean if you use a setting twice on a page it saves an extra DB query. But I'm thinking this is a total waste since it still does a full load on every page.

I was wondering if I stored the values into a cache file, would it make it load faster?

Does anyone know if a DB query every page would be faster or slower than a file load?