3
To make Magento aware of the Varnish servers, add the following section to app/etc/env.php. For Example:
'http_cache_hosts' =>
array (
0 =>
array (
'host' => 'varnish-0',
'port' => '80',
),
1 =>
array (
'host' => 'varnish-1',
'port' => '80',
),
),
In order to ensure the Varnish cache ...
1
your development must be separated from live. it is better for security and maintenance.
just copy your magento installation to another account / home folder.
copy nginx config, update root, domain and base url.
in varnish you need to add either one:
full domain bypass:
if (req.http.host ~ "^dev\.example\.com$") { return (pass); }
or parameter ?developer ...
1
Unfortunately changes in product data to configuration changes to automated processes such as currency updates will invalidate cache.
We had this on a magento 1 store and sounds like pretty much the same scenario in magento 2.
My best advice is create a console command which curls varnish via php
curl -X PURGE http://example.com/url1
I believe if you do ...
Only top voted, non community-wiki answers of a minimum length are eligible
Related Tags
varnish × 259magento2 × 127
cache × 74
turpentine × 37
nginx × 34
full-page-cache × 30
magento-1.9 × 28
magento-2.1 × 17
ssl × 16
redis × 15
performance × 12
magento-1.7 × 10
magento-1.8 × 8
https × 8
magento2.2 × 7
apache × 7
php × 6
magento2.3 × 6
magento-enterprise × 4
ce-1.9.1.0 × 4
cookie × 4
magento2.3.2 × 4
magento-1 × 3
blocks × 3
addtocart × 3