Varnish cache - How to purge/delete cache only for Home page

caching, drupal, drupal-7, varnish, varnish-vcl

Solution

You should invoke other command from Drupal:

ban req.http.host ~ www.cdm.me && req.url ~ "^/$"

Cache invalidated for whole site, because regexp "/" matches all URLs

Problem

I'm using Drupal 7 latest dev version. I have installed Varnish and Expire modules and setup them. They are working very well but I have one problem regarding deleting cache from varnish. The problem is how to delete varnish cache only for index(home) page and not to delete cache for other pages. I look at he varnish log and I found that whole varnish cache is deleted every time Drupal executes command ``` ban req.http.host ~ www.cdm.me && req.url ~ "/" ``` This command is executed by varnish module or expire module and it means delete cache of home(index) page. But as I see it is deleting all cached pages in varnish. How to fix this? How can I delete only cache for home page?

Original source