2

I`m trying to flush my magento cache via php script. I already tried

require_once('app/Mage.php');
Mage::app()->getCacheInstance()->flush();

or variations of it without any success.

I want to mention that I have varnish via turpentine installed.

However, pressing either Flush Magento Cache or Flush Cache Storage from admin will clear varnish cache. Just can't make it work from php script.

Can you point me in the right direction ? Thank you.

2
  • Obviously you skipped the part where I say that "I have varnish installed". bash script for /etc/init.d/varnish restart + standard flush from php was the solution. Thank you anyway.
    – Iulian
    Nov 21, 2013 at 14:36
  • this is not a duplicate because it refers to varnish and different implementations of varnish cache May 12, 2016 at 16:44

1 Answer 1

0

I just tried same code and it works fine. Make sure that you have implemented in this way.

create a file with your code embedded in php tag, lets say flush.php, place it magento root directory.

and hit the URL http://{my_base_url}/flush.php

1
  • The code is embedded in php and URL is domain/flush.php . Script is in root directory. However, varnish cache isn't purged.
    – Iulian
    Nov 21, 2013 at 7:49

Not the answer you're looking for? Browse other questions tagged or ask your own question.