I want to use apc_store()
to cache some results.
But I need to know where the data will be stored, and what's the limit.
Does it always store on memory? Or also writes to disk? I would prefer that the data that is not accessed very frequently is stored on disk. Should I use a different caching system for that?
Is this the limit? apc.shm_size = 32MB
. If so, what happens when I exceed it?
Data stored in the APC variable cache via apc_store()
is always stored in memory. If you need to store more data than this makes sense for, you'll need to come up with some other caching solution yourself.
The apc.shm_size
configuration directive sets the size of the whole APC shared memory cache, which is used for both opcodes and user variables. If you write more data to the cache than specified here, elements will be dropped from the cache, starting with the least recently used. Your code needs to be able to deal with this -- it's a cache, after all, not a database.