Thursday 01 April 2010 7:08:57 pm - 2 replies
I've done a function fetch in my extension, It may be called several times in a page, and I now the result is always the same, how can I make my fetch use a cache ?
I could use $GLOBALS of course and store in a specific key (hoping not to override an existing key), but I'm sure there's a better way
Any idea is welcome
Thursday 01 April 2010 9:06:11 pm
Well, honestly, if you just need to cache temporary data for one run, you should use a global... just centralize the read/write code for these globals so that you can easily refactor it, and prefix your global names with your initials or company acronym... just like we do with eZ. There should be no conflicts this way (not more than with classes, at least :p).
If you want to implement more persistent caching, here are the options I would consider:
You must be logged in to post messages in this topic!