I currently run nginx with Varnish in front on my Magento instance. I use Turpentine as the Varnish module for Magento. Without clearing the entire Varnish cache, is it possible just to flush the homepage cache?

  • 3
    This question appears to be off-topic because it is about how to clear varnish and not about magento Feb 25, 2014 at 23:37
  • 1
    @FabianBlechschmidt for me this is a valid question as the Turpentine extension is sending the flush commands to Varnish. Feb 26, 2014 at 5:42
  • ask the support contact of the module for this feature.
    – Flyingmana
    Feb 26, 2014 at 9:27

2 Answers 2


Not through Turpentine, but you can run this command (as root/sudo) to flush just the homepage (may need to adjust if Magento is not installed at the top level of your site):

varnishadm ban.url '^/(?:index\.php/?)?$'

There is no page in the module by default. Though, you could create your own page in the admin with a form to submit an URL.

Within the controller you only need a few lines of code to actually ban a URL from the Varnish cache.

$sockets = Mage::helper( 'turpentine/varnish' )->getSockets();
foreach($sockets  as $socket) {
   $socket->ban( 'req.http.host', '==', '{host_name}', '&&', 'req.url', '==', '{path}');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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