- How does Varnish caching make your site faster?
- How to install and activate it?
- Limitations you should be aware of
- Set cache time-to-live (TTL)
- Set up custom permalinks
- Purge all Varnish cache
How does Varnish caching make your site faster?
The first time that a visitor visits your site, VCache saves a copy of your site on a Varnish server. All subsequent visitors will be served with this copy, which takes less time than getting it from the storage server, thus making your site load faster.
The people behind Varnish have done a very good job of explaining how it works in the video below.
How to install and activate it?
The VCache plugin is enabled by default if you have used the 1-click installer to install WordPress. It will be visible in the menu to the left in your WordPress dashboard.
If the plugin is not enabled you can do this manually from the One.com parent plugin.
- In your WordPress dashboard, click One.com > Plugins.
- On the VCache tile, click Install and then Activate.
- Done! Click Varnish Caching to adjust settings.
Note: The VCache plugin is not available on the Starter packages. You need a to have a WordPress package, or a Plus/Business package with 200GB web space or more.
Limitations you should be aware of
There are some limitations you should be aware of when using the One.com VCache plugin.
- Each URL of your site needs to have been visited at least once before it is stored in the Varnish cache. So some pages of your site might be stored in VCache and some not.
- If you have a lot of dynamic content, like for example a header with changing images, we recommend disabling the VCache plugin. This is because the cached copy of your site on the Varnish server, may not be the same as the actual site.
- Plugins that require PHP executions don't work correctly with VCache enabled, for example, visitor counters.
Set cache time-to-live (TTL)
By default, the cache is set for 30 days, or 2592000 seconds. In most cases this is fine.
If you have a site with regular updates or if you are currently working on it, we recommend lowering it.
- In your WordPress dashboard, click Varnish Caching.
- Type in a new value for TTL.
- Click Save changes.
Tip: If you are working on a new version of your site, we recommend trying out the One.com Staging plugin. It allows you to try out changes, without your visitors noticing.
Set up custom permalinks
To make sure that the VCache plugin is working as intended, you need to have custom permalink settings. Luckily this is very easy.
- Click Settings > Permalinks.
- Select a custom permalink setting.
- Scroll down and click Save changes.
Purge all Varnish cache
If you don't want to wait until the cache is updated automatically, you can purge all varnish cache manually. That way you can check the latest changes on your site right away.
- Go to Varnish Caching in your WordPress dashboard.
- Click Purge ALL Varnish Cache.
The cache is purged automatically in the following cases.
- A page or post is added/updated.
- The active theme is changed.
- Varnish cache settings are saved.
- Widgets on your site are added/updated.