I was wondering how things like memcache and APC cache their data without writing it to txt files, primarily because I’m writing some open source software and want the ability to cache data, but not have files lying around. Obviously as open source software, I don’t want to require they have used PEAR or something similar to use APC. Ya know, robust?
Why not provide a selection of caching mechanisms for the end-user to choose from? Given some thought, your app’s code needn’t care about which one is being used.
I initially realized I wanted caching because in a globally included file it takes all the settings from a settings table and defines a constant with the setting name and it’s value, and I thought what a waste of time it was to be doing that every page load, when for the most part settings will stay the same (assuming). So it would be great to have a cached copy of them to check against.
As for Salathes remark, that does sound like an optimal idea, allow them to use APC or memcache if they have it installed, otherwise revert to using files, and make the class or functions that retrieve/set cached data use the various methods based on what they choose.