Prevent Varnish from caching Drupal RSS feed

After posting about Cloudflare, I realized that Feedburner wasn’t updating with the new post, even after pinging and re-syncing. Watching log files as I was testing the validator, I realized Varnish was serving a cached version of rss.xml. Inserting the following code in /etc/varnish/default.vcl resolved the issue:

// Skip the Varnish cache for rss feed
if (req.url ~ "rss\.xml") {
    return (pass);
}

Hope it helps!

Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>