Skip to content

Varnish on Cloudways: What It Is, When to Use It and How to Set It Up (2026 Guide)

On this page

Last updated: · By

Short answer: Varnish is a server-level cache layer that is installed and active out of the box on every Cloudways server. It serves visitors a ready-made copy of the page without running WordPress, so the site is faster and the server is less loaded. You turn it on or off in the server’s Manage Services, exclude URLs and cookies in the Varnish tab of the application settings, and change the cache lifetime (TTL) in Settings & Packages.

⏱ Time: 2–10 minutes per setting · Difficulty: easy to medium · Last checked against the official documentation: 6 Nov 2026

What Varnish is, and why it matters for your site

Before you touch any settings, here is what Varnish actually does.

Varnish Cache is an open-source HTTP accelerator that sits between the visitor’s browser and the web server. The first time someone requests a page, WordPress builds it as usual and Varnish keeps a copy. From the next request on, Varnish returns the stored copy immediately, with no PHP and no database queries.

You notice the result in two places. The first is load time, because a ready-made page is sent faster than one built from scratch. The second is server load: when most requests are answered from the cache, a small server can serve many more visitors at once. This matters most on a sale day, during a paid campaign, or after an article that brought sudden traffic.

According to Cloudways’ official documentation (updated August 2025), the Varnish version on the servers is 6.0.x, and it is active by default on every new server. One more useful detail: if the web server stalls for a moment, Varnish can still serve the pages it has already stored.

Which applications Varnish works with

ApplicationVarnish compatibilityNote
WordPress (including WooCommerce and Multisite)Fully compatibleExclusions for the cart, checkout and account area are preconfigured
Magento 2Fully compatibleUses Magento’s own VCL file, with no extra plugin
LaravelNot compatibleTurn Varnish off at the application level
Custom PHPNot compatibleTurn Varnish off at the application level

Varnish vs the other cache layers

A Cloudways server has several cache layers, and each does something different. They do not compete with each other; they complement each other.

LayerWhat it storesWhere it runsWhen it helps most
VarnishWhole pagesOn the server, before WordPressAnonymous visitors, traffic spikes
Redis / Object CacheResults of database queriesOn the server, inside WordPressLogged-in users, WooCommerce, the admin area
BreezeHTML files, CSS/JS minification, purge managementA WordPress pluginFile optimization and automatic Varnish purging
CDN (for example Cloudflare)Files and pages on edge serversOutside the server, close to the visitorA global audience, taking load off the server

The key point: Varnish on its own does not know when you publish a new post. What tells it to purge the old copies is the Breeze plugin, through the Auto Purge Varnish option. Without a plugin like that, an old page can stay in the cache until its lifetime runs out. To pick the right plugin, read the comparison of cache plugins for Cloudways.

Before you start

  • Access to the platform with permission for the server and the application (the account owner, or a team member with the right permissions).
  • Know what runs on the server. Turning Varnish on or off and changing the TTL apply to all applications on the server, including Staging environments.
  • On a WordPress site, make sure Breeze is installed and that Auto Purge Varnish is ticked (in the plugin’s Varnish tab).
  • Exclusions do not delete pages that are already stored. After you add a rule, purge the cache (see the guide to clearing the cache).

How to turn Varnish on or off on a server

This is the master setting. When it is off, no application on the server gets Varnish caching.

  1. Log in to the platform and open the Servers tab under Flexible.
  2. Choose the server you want.
  3. In the server menu, go to Manage Services.
  4. On the Varnish row, click Enable to turn it on or Disable to turn it off.

How to turn Varnish off for a single application

Useful when the same server hosts a WordPress site and next to it a Laravel or custom PHP application. Varnish stays active for the other sites.

  1. Make sure Varnish is on at the server level (the previous section).
  2. In the Servers tab, choose the server, click www and choose the application.
  3. In the application menu, go to Application Settings.
  4. In the General tab, turn off the Varnish toggle.
  5. Confirm with OK.
General application settings in Cloudways with the Varnish toggle, reset permissions and cache clearing
The General tab in the application settings, with the Varnish toggle (it is on in the screenshot)

How to exclude URLs and cookies from Varnish (exclusion rules)

Here is when you need exclusion rules, what is already excluded out of the box, and how to add a rule of your own.

What is already excluded by default

Cloudways ships a Varnish configuration file (a VCL file) that already excludes what must not be cached. On most sites you do not need to add anything. Here are the main WordPress exclusions:

GroupExamples of what is excluded
GeneralAll POST requests, and sites protected with an HTTP password
WordPress/wp-login.php, /wp-admin, /wp-json, /wp-cron, /xmlrpc.php, preview (?preview=true), the RSS feed
WooCommerce/cart, /checkout, /my-account, /wc-api, /?add-to-cart=, /logout, /lost-password
Cookieswordpress_logged_in, wp-postpass, wordpress_comment_, woocommerce_cart, woocommerce_session
Easy Digital DownloadsEDD pages and cookies

When to add an exclusion anyway

  • Custom dynamic pages: a booking system, a price calculator, a form with a remaining-spots counter.
  • A plugin that sets its own session cookie: for example a membership or account-area plugin that is not WooCommerce.

Adding an exclusion rule, step by step

  1. In the Servers tab, choose the server, click www and choose the application.
  2. Go to Application Settings and switch to the Varnish tab.
  3. Click Add New Exclusion.
  4. In the Type field, choose URL (an address) or Cookie.
  5. In the Value field, type a relative path (for example /booking/) or the full cookie name.
  6. Click Save, and then purge the Varnish cache so the old copies are deleted.
The Varnish tab in the Cloudways application settings with exclusion rules and the Add New Exclusion button
The Varnish tab in the application settings. From there you click Add New Exclusion to add a rule

Three rules worth remembering. Only relative paths work: /mypage.php yes, a full https address no. Regular expressions (Regex) are allowed. And a partial path like /booking/ also excludes everything beneath it, such as /booking/list. The rules you added appear on the same screen, and you can edit or delete them at any time.

What Ignore Query String is and when to turn it on

A query string is everything that comes after the question mark in a URL, for example ?utm_source=facebook or ?fbclid=.... Facebook, Google Ads and email tools add parameters like these to every click.

The problem: by default Varnish treats every URL with a different parameter as a new page. Since fbclid is unique to each click, every visitor from a Facebook campaign gets a page that is not served from the cache. The very visitors you paid for get the slowest page.

When you turn on Ignore Query String, Varnish ignores well-known tracking parameters and serves everyone the same stored copy. The list includes, among others, utm_* (all UTM parameters), fbclid, gclid, msclkid, mc_cid and mc_eid. The option is available only in the new interface, and only when Varnish is on both on the server and in the application.

  1. In the Servers tab, choose the server, click www and choose the application.
  2. In the application menu, go to Application Settings.
  3. Switch to the General tab.
  4. Turn on the Ignore Query String toggle.
  5. Confirm in the window that opens by clicking Confirm.
Toggles for Geo IP, CORS, device detection and Ignore Query String
More toggles in the application settings

When not to turn it on: Cloudways notes that the option may affect third-party tracking and analytics tools. If your campaigns depend on reading the parameters on the server side (for example a plugin that preserves UTM values in a contact form), test it in a Staging environment first. Another option Cloudways mentions is WP Rocket, which lets you manage the parameters without stripping them.

How to change the cache lifetime (Varnish TTL)

TTL (Time To Live) is how long Varnish keeps a copy before it asks for a fresh version. The default on Cloudways is 4 hours. The change is made at the server level, so it affects all the applications on it.

  1. In the Servers tab, choose the server.
  2. In the server menu, go to Settings & Packages.
  3. Switch to the Advanced tab and scroll to Cache Lifetime under Varnish.
  4. Choose a value, for example 4, 8, 14 or 24 hours.
  5. Click Save Changes.
The Varnish Cache Lifetime field in the Advanced tab of the server settings on Cloudways
Advanced PHP and MySQL settings
Site typeA TTL that usually fitsWhy
A brochure site that is rarely updated14–24 hoursMore requests are answered from the cache, less load
A blog or magazine with daily publishing4–8 hoursBreeze purges on every publish anyway; a medium TTL is a safety net
A news site or promotions that change every hour4 hours (the default)Less risk that a visitor sees an old price or headline

The recommendations in the table come from experience, not from a Cloudways rule. The official rule is simple: if you change content often, set a low value; if the content is stable, a high one.

Black Friday80% off
80% off 2 months of managed hosting

The code BFCM802 takes 80% off your bill for the first two months (up to $200 off per month), including unlimited free site migrations. New customers only, and only until the offer ends.

The offer ends on December 4, 2026 at 23:59 (UTC+2).

Ends in—days—hours—minutes—seconds
Code:
Grab the 80% now

Start with a free trial, no credit card. Enter the code at checkout and check that it shows up.

After Black Friday: 30% off for 3 months with the code ASAEL. On a large server (above about $444 a month) ASAEL already saves more today. BFCM802 vs. ASAEL calculator

Common mistakes and how to fix them

I changed something on the site and I still see the old version: the page is sitting in the cache. Make sure Auto Purge Varnish in Breeze is ticked, and purge manually through Purge Varnish Cache in the plugin, or through the Purge button in the Purge Site Cache section of the General tab in the application settings.

A visitor sees someone else’s cart, or an empty cart: almost always a cart or checkout page with a custom URL that was not excluded. Add a URL exclusion for the translated path and purge the cache. More on cart and checkout caching in WooCommerce cache and cart issues.

Pages are not cached at all (a constant MISS): the usual cause is a cookie that a plugin sets for every visitor, which makes Varnish skip the cache. Temporarily turn off plugins that set cookies (the documentation mentions WordPress Download Manager, for example) and check again.

Login, a session or a form does not work on a particular page: by default Varnish does not always pass the Cookie header to PHP. Exclude that URL so the request goes straight to the server.

A 404 page keeps showing after you fixed it: Varnish also caches 404 pages, for five minutes. Wait a few minutes or purge the cache.

A Laravel application behaves strangely: Varnish is not compatible with Laravel and Custom PHP. Turn it off for that application only.

Sources

This page is based on the following official documentation and pages:

Frequently asked questions

Is Varnish active automatically on a Cloudways server?

Yes. Varnish is installed and active by default on every new server, and applies to all applications on the server. You can turn it off for the whole server through Manage Services, or for a specific application only through Application Settings.

Does Varnish work with HTTPS?

Yes. According to Cloudways, applications and plugins that support Varnish on the platform also work with HTTPS, so you do not have to choose between an SSL certificate and caching.

Do I need Varnish if I have WP Rocket or Breeze?

Usually yes. Varnish works at the server level, before WordPress even loads, and the cache plugin manages its purging and file optimization. The Breeze and Varnish combination is preconfigured on Cloudways.

Will Ignore Query String hurt Google Analytics tracking?

In most cases no, because browser-side tracking tools read the URL the visitor sees. Cloudways notes that the option may affect third-party tracking, so if you have a plugin that reads UTM values on the server side, test in a Staging environment first.

What is the default Varnish cache time?

4 hours. You can change it to 8, 14 or 24 hours through Settings & Packages in the Advanced tab. The change applies to all applications on the server.

Can I exclude a page with a non-English URL from Varnish?

Yes. You add a URL-type exclusion rule with the page’s relative path. The official documentation explicitly recommends adding translated paths, such as a cart or checkout in another language, because the built-in exclusions only know the English paths.

Official source: How to Use Varnish at Cloudways, How to Enable ‘Ignore Query String’ for Varnish Cache (Cloudways Knowledge Base). Written and checked by Asael Dreyer · Updated: 6 Nov 2026

Disclosure: this is an independent site, not the official Cloudways site. Some links on this site are affiliate links: if you sign up through them we earn a commission, at no extra cost to you. Full details

Picture of Asael Dreyer
Asael Dreyer

Hi, I'm Asael Dreyer, CEO of an SEO agency that runs hundreds of websites hosted on dozens of Cloudways servers.
Everything you will find here comes from hands-on experience, mine and my teams', straight from the field: from the guides to the recommendations. All to help you get the most out of Cloudways.

More about me →

Need help? Got a question about your server or this guide? Write to us and we will get back to you.

More guides on this topic:
מפריד
Thanks for your message!
We will get back to you soon.
Ready to get started?

Sign up with the coupon code ASAEL