I am using memcache to store larger session data that is choking the MYSQL/PHP limitations.
One thing however, is that these may not be requested again, and hence the ‘lazy’ memcache purging may not work.
Im trying to determine if there is a function that will purge all expired caches without having to walk through all of them.
OR … if memcache will only consume so much memory, and then purge the expired as needed to make room ..
Just looking for the most optimal way to handle these caches.
Thanks
I’m not really sure what you mean by this. There is no need to purge stuff that is expired. If it is expired, it doesn’t really count anymore. You won’t get these results because they aren’t valid anymore (expired).
Well, if you have expired items, they will be overwritten, so I don’t see what the issue is.
Lets say you have room for 2 key/value pairs. If you have one that is expired, and one that is used but not expired, and you need to save a third, you can. You don’t need to actually purge anything, because it will remove the expired one.