K
K
Ken Jee2016-09-25 17:33:56
Yii
Ken Jee, 2016-09-25 17:33:56

How to force Yii2 not to use md5 for hashing Redis keys in the \yii\redis\Cache class?

It is very necessary to make sure that Yii2 using the \yii\redis\Cache class does not hash key names.

// prefix:keyname1 -> 0e46d28d5fb7676bffd12253c26aec56
Yii::$app->cache->set( 'prefix:keyname1', 'key-value-1, 60 * 60 * 24 ); 

// keyname2 -> keyname2 
Yii::$app->cache->set( 'keyname2', 'key-value-2, 60 * 60 * 24 );

The essence of the problem lies in the fact that if there are symbols ':', '@', etc. in the name of the key. - the \yii\redis\Cache class will hash these key names with the md5 algorithm... How can I force \yii\redis\Cache not to do this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2016-09-25
@webinar

www.yiiframework.com/doc-2.0/yii-caching-cache.htm...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question