CodeIgniter Forums

Full Version: Memcache no expires not working!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have set the time to 0 to make it unlimited, It should not expire but after 1 hour, the cache is nowhere to find.
That's mission impossible with Memcache, and pointless when talking about cache stores in general.
(09-29-2016, 03:41 AM)Narf Wrote: [ -> ]That's mission impossible with Memcache, and pointless when talking about cache stores in general.

http://php.net/manual/en/memcached.expiration.php

"If the expiration value is 0 (the default), the item never expires ".

So it should not expire. But it's not working.
Narf is correct, a cache is just that "a cache" if it's gone then your code should recreate it?
If your site needs the cache to run then you need to rethink your code or not use a cache.

Don Myers
(09-29-2016, 07:35 AM)dmyers Wrote: [ -> ]Narf is correct, a cache is just that "a cache" if it's gone then your code should recreate it?
If your site needs the cache to run then you need to rethink your code or not use a cache.

Don Myers

I was just saving a temporary data to the memcache because the data will not needed until we reject a users data. Why cache? saving it to the database is totally pointless because it will be deleted anyway(until I want to delete it). It also cause a high query loads.
Is CodeIgniter actually adding your data to memcache?
Have you used a 3rd party application to verify?
How much memory have you given memcache is it enough to hold everything you want to store so nothing is flushed?
I am using CodeIgniter memcache and it is working fine for me. Perhaps you are using a edge case?

This might also help: http://serverfault.com/questions/144971/...elete-keys
(09-29-2016, 09:34 AM)dmyers Wrote: [ -> ]Is CodeIgniter actually adding your data to memcache?
Have you used a 3rd party application to verify?
How much memory have you given memcache is it enough to hold everything you want to store so nothing is flushed?
I am using CodeIgniter memcache and it is working fine for me. Perhaps you are using a edge case?

This might also help: http://serverfault.com/questions/144971/...elete-keys

I am using CodeIgniter memcache and it's working fine except to 0 (never expire). I have some keys that delete every hour/day/15 days and it works perfectly fine.