How to force Varnish to update cache contents
Every freistilbox cluster on our managed hosting platform has its own Varnish proxy cache. This cache stores content according to the HTTP headers that came with it. When the cache lifetime of a specific content object expires, Varnish will remove it from its cache store and request an update from your web application.
Cache invalidation using the Drupal Purge module
The Varnish Purger module allows invalidating whole sets of cache objects at once by using
Cache Tags. This method uses the
Cache-Tags HTTP header to label content with one or more tags. All content with a certain tag can then be removed from the cache using a
BAN request for this tag.
Configure the Varnish Purger module using the following details:
cXXv.freistilbox.net(use your own cluster ID followed by a
vfor Varnish, for example
- Path: ’/`
- Request method:
Also make sure that the Varnish Purger Tags submodule is configured like this:
You can find a detailed description of the setup process in Mikke Schirén’s blog post
Purge cache-tags with Varnish.
Manual cache invalidation
To manually remove a certain content object from the cache, you can send a
PURGE request with its URL from the command line:
curl -X PURGE http://my.dom.ain/path/to/the/content
This command will remove the object referenced by the URL from the cache.