2

I want to change the default Memcache serializer (Memcached::SERIALIZER_PHP) by replacing it by Igbinary (Memcached::SERIALIZER_IGBINARY) in a server that already contains caches.

If I make the change, I think that the Memcache server will attempt to unserialize the old caches with Igbinary and, therefore, it will crash.

Is that assumption correct? Is it necessary to perform a flush_all action in order to avoid errors?

vicentazo
  • 1,739
  • 15
  • 19
  • I'm not sure what you want to do, but flush_all will mark all entries invalid by setting the experation date to now. If this is acceptable for you, it's probably a solution. – marfis Jul 17 '14 at 11:17
  • I want to change the serializer and I don't know if it is **absolutely necessary** to perform a `flush_all` – vicentazo Jul 17 '14 at 11:30
  • It think there is no option to do this "on the fly". But you certainly can update (deserialize (old way) / serialize (new way)) every entry by script. In case you can accept rebuilding your caches, flush_all is less sophisticated. – marfis Jul 17 '14 at 11:37
  • @marfis I prefer invalidate all caches because it's much easier and I can assume it. Thanks! – vicentazo Jul 21 '14 at 14:49

1 Answers1

1

That's correct. If you changethe Memcached serializer all existing entries are incompatible. You will need to perfom a flush_all to start fresh as you mentionned.

gimpe
  • 1,057
  • 10
  • 12