![]() |
Memcache no expires not working! - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Memcache no expires not working! (/showthread.php?tid=66260) |
Memcache no expires not working! - aw1212 - 09-29-2016 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. RE: Memcache no expires not working! - Narf - 09-29-2016 That's mission impossible with Memcache, and pointless when talking about cache stores in general. RE: Memcache no expires not working! - aw1212 - 09-29-2016 (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. RE: Memcache no expires not working! - dmyers - 09-29-2016 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 RE: Memcache no expires not working! - aw1212 - 09-29-2016 (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? 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. RE: Memcache no expires not working! - dmyers - 09-29-2016 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/what-causes-memcache-to-delete-keys RE: Memcache no expires not working! - aw1212 - 09-30-2016 (09-29-2016, 09:34 AM)dmyers Wrote: Is CodeIgniter actually adding your data to memcache? 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. |