改YII源码
找到\yiisoft\yii2\filters\PageCache.php 添加自定义方法
```php
public function clearPageCache($variations=[]){
if($variations){
$this->variations = $variations;
}
$this->cache = Instance::ensure($this->cache, 'yii\caching\CacheInterface');
return $this->cache->delete($this->calculateCacheKey());
}
使用案例
//清理某个页面缓存
Yii::$app->requestedRoute = '';//页面路由
$rsult = (new \yii\filters\PageCache())->clearPageCache([
//这里填页面缓存参数
]);
var_export($rsult);