Update Cache_redis.php

Do type checking before `serialize()` / `unserialize()` functions