Cache clearing multiple Varnish instances
- Topics:
- Configuration
- Cache
CREATED FOR:
- Experienced
- Admin
- Developer
Adobe Commerce supports multiple Varnish instances out of the box.
This topic shows the basics of configuring multiple Varnish instances with Commerce.
Configuration to purge multiple Varnish instances
Commerce purges Varnish hosts after you configure Varnish hosts using the magento setup:config:set
command.
You should use the --http-cache-hosts
parameter to specify a comma-separated list of Varnish hosts and listen ports. (Do not separate hosts with a space character.)
The parameter format must be <hostname or ip>:<listen port>
, where you can omit <listen port>
if it is port 80.
For example,
bin/magento setup:config:set --http-cache-hosts=192.0.2.100,192.0.2.155:8080
You can then purge all Varnish hosts when you refresh the Commerce cache (also referred to as cleaning the cache) in the Admin or using the command line.
To refresh the cache using the Admin, click SYSTEM > Tools > Cache Management, then click Flush Magento Cache at the top of the page. (You can also refresh individual cache types.)
To refresh the cache of multiple Varnish instances from cli use the magento cache:clean <type>
command as the file system owner.
Commerce
- Overview
- General setup
- Deployment
- Cache
- Command Line
- Command-line tool
- Common commands
- Enable logging
- Manage the cache
- Manage indexers
- Configure cron jobs
- Compile code
- Operation mode
- Start message queue consumers
- URN highlighter
- Dependency reports
- Localization
- Configuration management
- Static view
- Create symlinks
- Run unit tests
- Convert layout files
- Generate data for performance testing
- Run support utilities (Commerce only)
- Configuration files
- Configuration paths
- Cron Jobs
- Logs
- Message Queues
- Multiple sites
- Search Engine
- Security
- Storage
- Return to Operational Guides