Varnish¶
Varnish Concepts¶
Varnish Built-In Functions & Keywords
Installing Varnish¶
1. Install the package¶
sudo yum -y install varnish
sudo systemctl enable varnish
- To enable varnish to start on rebootvarnishd -V
- Check version & installed correctly
2. Installing Magento Module¶
Switch to a new branch for the installation and download the relevant platform module.
3. Add Parameters on Daemon¶
Edit varnish daemon parameters - vim /etc/varnish/varnish.params
DAEMON_OPTS="-p feature=+esi_ignore_other_elements -p cli_buffer=16384 -p vcc_allow_inline_c=on"
4. Lastly edit your Web Server (Apache/Nginx) configuration to use varnish.¶
Redacted
Varnish Logging¶
-
varnishlog
- Varnish Log, isgrep
able so you can use commands likevarnishlog | grep Mobile
(will show user-agents with mobile in name) -
varnishhist
- Varnish history will show a bar like graph using|
for hit varnish pages and#
for missed cached hits.
The full varnish log will give you an indication on what is happening at different stages. Cross-reference this with the vcl
file you are using with varnish.
For Example:
- VCL_call HIT
Anything after this line until the next VCL_call will relate to the subroutinevcl_hit
.