Clearing Symfony cache for another application

后端 未结 5 2252
不知归路
不知归路 2021-02-10 05:37

I would like to clear my frontend application\'s cache from an action in my backend application.

How can I achieve this?

5条回答
  •  误落风尘
    2021-02-10 06:30

    If anyone is looking for clearing one cache item (one page):

    sfContext::switchTo('frontend');
    sfContext::getInstance()->getViewCacheManager()->remove("module/action?¶m1=value1¶m2=value2","THE-DOMAIN-OF-YOUR-FRONTEND-APPLICATION-IF-U-USE-IT-IN-CACHE-KEYS");
    sfContext::switchTo('backend');
    

提交回复
热议问题