문제

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?

도움이 되었습니까?

해결책

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}');
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top