HfogDocsv1.0.0

Varnish

Turn on your own Varnish page cache, choose which websites go through it, see its figures and empty it.

The Varnish screen gives your account its own page cache in front of your websites. Pages for visitors who are not logged in come straight from memory; logins, carts, checkouts and admin pages are never cached. It suits WordPress, WooCommerce and Magento.

Where: Control Panel › Databases › Varnish

Turn on Varnish

  1. Choose the Memory size.
  2. Click Turn on Varnish.

The sizes offered are 64 MB, 128 MB, 256 MB, 512 MB, 1 GB and more, up to your package's Varnish limit. 256 MB is chosen by default when it is allowed. To change the size, turn Varnish off and on again with the new size.

Note: if the screen says Your hosting plan does not include Varnish, ask your hosting provider to add it.

Choose the websites

The Websites card lists your websites. Click Turn on next to a website to send its pages through Varnish, and Turn off to send them straight to the web server again. Images, styles and scripts are still served straight from disk. While a website goes through Varnish, the web server's own page cache is not used for it.

Note: Varnish works with websites on Nginx + Apache. A website on Nginx only shows Needs the website on Nginx + Apache.; change its web server under Websites first.

What is never cached

  • requests other than GET and HEAD, and requests with a login (Authorization)
  • WordPress admin and login pages, carts, checkouts, accounts, wish lists, Magento's admin, and searches
  • visitors with a session or login cookie (tracking cookies such as Google Analytics are ignored)
  • pages that set a cookie or say private, no-store or no-cache

Responses carry an X-HF-Varnish: HIT or MISS header, so you can see what came from the cache.

Empty the cache

  • Empty next to a website removes that website's pages.
  • Empty the cache removes everything.

Your website can also empty its own pages: a PURGE request for one address, or a BAN, sent to the website from the server itself. WordPress cache purge plugins and Magento's Varnish setting (with this website as the Varnish host) do this for you. Magento's cache tags (X-Magento-Tags-Pattern) are understood.

Turn off Varnish

Turn off Varnish asks for confirmation, then sends every website straight to the web server again and frees the memory.

Note: while your account is suspended, its Varnish is stopped; it starts again when the account is unsuspended.