taurus-media / module-varnish-config
Magento 2 module that automatically downloads a VCL template and applies Varnish configuration via cron
Package info
github.com/taurus-media/module-varnish-config
Type:magento2-module
pkg:composer/taurus-media/module-varnish-config
Requires
- php: >=8.1
- magento/framework: *
- magento/module-page-cache: *
This package is auto-updated.
Last update: 2026-04-28 12:44:43 UTC
README
A Magento 2 module that automatically keeps your Varnish configuration up to date by downloading a remote VCL template, processing it with Magento's native placeholder substitution, and applying it to the running Varnish instance.
How it works
- A cron job runs once a day
- The VCL template is downloaded from a configured URL
- Magento's built-in
VclGeneratorreplaces all standard placeholders with live values from the store configuration (backend host/port, access list, grace period, SSL offload header, design exceptions) - The processed VCL is saved to
var/tmp/varnish_extended.vcl - The new configuration is loaded and activated via
varnishadm:varnishadm vcl.load magento2 <file> varnishadm vcl.use magento2
NOTE: vcl.load and vcl.use commands are not flushing the already cached pages.
Requirements
- Magento 2 with
Magento_PageCachemodule - PHP 8.1+
varnishadmavailable in the systemPATHof the user running Magento cron
Installation
composer require taurus-media/module-varnish-config bin/magento module:enable Taurus_VarnishConfig bin/magento setup:upgrade
CLI command
The VCL update can also be triggered manually:
bin/magento taurus:varnish:update-vcl
This runs the same logic as the cron job and exits with code 0 on success or 1 on failure, making it suitable for use in deployment pipelines.