Answer the question
In order to leave comments, you need to log in
How to delete blocks in Cache in Yii2?
Yii2 allows you to cache arbitrary objects.
For example, I'm caching results from an API. I add the key from the class, function name and parameters. In the future, I will probably redo the method to immediately pass the array directly as a key.
CustomerCustomerRepositoryV1Api -> customerGroupRepositoryV1GetListGet(args)
public function generateCacheKey($class, $method, array $args)
{
return $class . '->' . $method . '(' . \serialize($args) . ')';
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question