Varnish

Varnish Cache is a web application accelerator also known as a caching HTTP reverse proxy. You install it in front of any HTTP server and configure it to cache the contents.

Installation

Install the varnish package.

Customizing Varnish

By default, varnish comes configured in /etc/varnish/default.vcl to use localhost:8080 as the only backend, default.vcl is called by the default varnish.service file.

You can enable the unit as-is, or override the defaults by editing it.

[Service]
ExecStart=
ExecStart=/usr/bin/varnishd -j unix,user=nobody -F -a :6081 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,1G

Also, if you change the configuration file /etc/varnish/default.vcl you will need to reload varnish.service:

Manual VCL load

If the previous VCL configuration reload failed, try loading the VCL file manually:

  1. Connect to the varnish console:
    $ varnishadm -T localhost:6082
  2. Load the default VCL. Make sure it has at least one backend:
    varnish> vcl.load default /etc/varnish/default.vcl
  3. Make it active:
    varnish> vcl.use default
  4. Start the child proccess (optional):
    varnish> start
gollark: You could as far as I know buy a dedicated telephone line between two points for data purposes last century.
gollark: That's running data over voice-y lines.
gollark: No, I'm not thinking of dial up.
gollark: That is what the original internet ran on, no?
gollark: Leased telephone lines.
This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.