Open ClaudiuCreanga opened 8 years ago
So this would work for individual links: Mage::getModel('varnishcache/control') ->clean($host, sprintf('^%s$', $uri));
You can purge URL programmatically with this simple code snippet:
$cache = Mage::getSingleton('varnishcache/control');
if ($cache)
{
$cache->clean($_SERVER['HTTP_HOST'], 'URL/HERE');
}
Is there a way to purge the url programatically?
I'm updating the stock by writing to the database directly and would like to purge product urls (or by product id) afterwards (not on product save).
Or, if not, how would you go about purging all varnish programatically? (Mage::app()->cleanCache()) doesn't work.
Thanks!