public function cacheKey(Model $model, $keys, $prefix = true)
    {

        // TranslateBehavior support
        if (!empty($model->locale)) {
            $keys = array_merge((array)$model->locale, (array)$keys);
        }

        if (is_array($keys)) {
            $key = array_shift($keys);

            if ($keys) {
                foreach ($keys as $value) {
                    if (is_array($value)) {
                        $key .= '-' . md5(json_encode($value));
                    } else if ($value) {
                        $key .= '-' . $value;
                    }
                }
            }
        } else {
            $key = (string)$keys;
        }

        if ($prefix) {
            $key = (string)$this->settings[$model->alias]['prefix'] . $key;
        }

        // Replace AppModel with the current Model so we don't run into conflicts
        $key = str_replace(array('AppModel', '::'), array($model->alias, '_'), $key);

        return $key;
    }