Every freistilbox cluster on our managed hosting platform has its own Varnish content 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.
Triggering a cache update requires connecting to the active Varnish node. Even though your freistilbox cluster might have more than one Varnish server (especially if you have a freistilbox Pro oder Enterprise cluster), the hosting platform maintains a hostname that always points to the active node. Its name consists of your Cluster ID with a “v” for “Varnish” appended, for example “c61v”.
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 “v” for Varnish, for example
- Path: ‘/`
- Request method:
Also make sure that the Varnish Purger Tags submodule is configured like this:
To manually remove a certain content object from the cache, you can send a
PURGE request with its URL from the command line on your
As an example, let’s assume we want to refresh the cached content for the URL
curl command sends a HTTP request to the active Varnish instance
of your cluster, using the document path we want to invalidate. However,
instead of the usual
GET, it uses the
PURGE request method. It also includes
Host header to identify your website’s domain name.
curl -X PURGE http://c61v.freistilbox.net/tralalaa.css \ -H "Host: www.example.com"
If your website enforces encryption by redirecting any
http:// URL to its
https:// equivalent, you need to add another header named
curl -X PURGE http://c61v.freistilbox.net/tralalaa.css \ -H "Host: www.example.com" -H "X-Forwarded-Proto: https"
After you’ve issued this command, Varnish will refresh the content for the given URL.