5

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 – Fabian Blechschmidt Feb 25 '14 at 23:37
  • 1
    @FabianBlechschmidt for me this is a valid question as the Turpentine extension is sending the flush commands to Varnish. – Matthias Zeis Feb 26 '14 at 5:42
  • ask the support contact of the module for this feature. – Flyingmana Feb 26 '14 at 9:27
7

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/?)?$'
1

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, privacy policy and cookie policy

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