Hello,
I'm writing a portable PHP website (that should run on Windows and on Linux and maybe some others OS also). I am looking for the best way of caching some data that usually comes from database or from the resource files.
It's obvious that it would be wize for me to reduce some of those DB queryes – since the result is always the same. There will be more stuff (like page translations) that I would like to keep on memory (or somewhere where I can access it fast).
There is no point of reading some translation files (or some settings or ini or cnf files) with every request? Or is there? Maybe PHP can read the files so fast that I do not have to bother myself with this topic?
Pear has 2 solutions for this. So there is no point of rolling my own.
http://pear.php.net/packages.php?catpid=3&catname=Caching
And if I understood it correctly then - basically one of them is simply using filesystem (file container) and the other one is bit more complicated – it also uses shard memory.
I’d like to know if I can use the those shared memory classes on Windows platform? I want my site to be portable – and a’m afraid I can’t use the shared memory approach – I have to go for the file container approach?
But then I red (http://www.onlamp.com/pub/a/php/2001/10/11/pearcache.html) that the file container approach (pear’s cache_lite) is actually faster then the shared memory approach (pear’s cache). Is it true?
Can you give me some tips or hints. Should I go for the cache_lihgt or for the cache? Or once againg – maybe reading some translation files on the fly will not affect the overall performance after all?
In ASP I would have handleled those situations with application scope variables.
Than U,