The Essential Varnish
Is your website slow? Understand how Varnish speeds up loading, protects personal data, and why professional diagnostics are key to performance.

Sur cette page6 sections
You open your website to show a project to a client, and the page takes a while to load. Your first thought is your connection. Then you try again on another phone, and the result is the same. When you know your site, you tend to wait. Someone discovering it for the first time might not have that patience.
The reflex is then to want more powerful hosting or a tool supposed to speed everything up. Varnish can be part of the answer, but not just because its name appears on a list of high-performance technologies. Its benefit is more specific: avoiding repeating certain processes when multiple visitors request the same public content.
The goal isn't to make you choose caching software. It's to understand what can be accelerated, what must remain calculated for each individual, and how to verify that the site still works correctly after changes.
This setup is useful: you modify a service in your admin area, and the site knows how to present it. But if several people view this service without it having changed, the server can end up generating a very similar response multiple times.
Varnish sits in front of the application and can store a public response to reuse it. This is known as an HTTP cache. If the available response matches the request and remains usable according to defined rules, it can be served without asking the application to rebuild everything. Otherwise, the request is passed through.
Imagine a project page showing the same photos and text to all visitors. It makes sense to prepare this response once and then reuse it. On the other hand, there is no reason to treat a client area like that public page. That is the whole difference between setting up a cache and correctly deciding what it is allowed to store.
La Varnish documentation presents the rules that drive this process. You don't need to learn their configuration language to use your site, but someone needs to understand it to operate it.
But a page can respond quickly and still be frustrating to use. Oversized photos, scripts that delay display, or a layout that shifts during loading don't disappear just because Varnish handled the request. The visitor's phone and connection also matter.
This is why I advise you to start by measuring the problem. Are you waiting for the first server response, the images to load, or the moment you can actually use the page? These are different types of waiting, which aren't always fixed in the same place.
If server resources are insufficient, if a database query is abnormally costly, or if an image is several megabytes, these issues must be examined. Adding a cache is no substitute for understanding why the site is performing poorly. La documentation sur les Varnish performance also details the constraints of its own operation.
For the visitor, the expected result remains simple: access information, browse your services, and contact you without unnecessary waiting. L'article sur les Core Web Vitals and site speed provides a broader perspective beyond server caching.
The task is therefore to identify these journeys and protect them. We don't disable session and cookie precautions just to show a better cache hit rate. La documentation on caching conditions explains the role of cookies and response headers.
A page can also mix public and personal information. Techniques exist to separate certain parts, but this isn't a general permission to cache the entire page. You must understand what varies, test the rules, and know how the site behaves when this separation doesn't work as expected.
For you, this means a test shouldn't be limited to opening the homepage. You must also check the functions your business depends on: sending a form, logging in, modifying a basket, opening a booking. Speeding up the storefront while breaking the ordering process would not be progress.
We can define a retention period and remove responses from the cache when the relevant content changes. Varnish documente plusieurs mécanismes d'cache invalidation. The choice depends notably on how your site publishes its content and links its pages.
An added project might, for example, modify its own page, the project list, and a block showing the latest projects. You have to think about these dependencies. Clearing only the modified page isn't always enough; clearing everything with every change can also remove much of the cache's benefit.
Before considering the installation complete, I advise you to make a real test modification, then check the result as a visitor, without being logged into the admin area. What you see with your account isn't necessarily what another person receives.
This possibility applies to the content and durations we have planned for. It doesn't mean an order can be processed without the application, nor that the entire site will continue to function after any failure. Nor does it turn Varnish into complete protection against denial-of-service attacks, which seek to make a service unavailable by overloading it.
It remains necessary to monitor infrastructure, maintain components, and prepare backups. La question du cache rejoint donc celle de la site maintenance : who checks the operation, who intervenes if responses become incorrect, and who adapts the rules as the site evolves?
From there, the work I propose consists of looking at the pages and journeys involved, measuring where the delay is, and then choosing an appropriate fix. If a cache is relevant, we must define what it can store, test personal areas, and verify that publications correctly update the responses. Then, we compare the operation before and after, instead of just settling for the presence of a new tool.
This approach can lead to using Varnish, reviewing its configuration if it's already present, or fixing another problem as a priority. The technical choice must serve your site, not the other way around. An additional component also requires maintenance; if it doesn't bring a useful benefit, there's no reason to add it just for the sake of it.
If you don't know why your site is slow or if you want to overhaul its operation before it bothers your customers, we can start by discussing it.
The reflex is then to want more powerful hosting or a tool supposed to speed everything up. Varnish can be part of the answer, but not just because its name appears on a list of high-performance technologies. Its benefit is more specific: avoiding repeating certain processes when multiple visitors request the same public content.
The goal isn't to make you choose caching software. It's to understand what can be accelerated, what must remain calculated for each individual, and how to verify that the site still works correctly after changes.
Why is your server repeating the same work?
When a visitor opens a page, the site may need to retrieve information, compose the content, and prepare the response that the browser will display. On a manageable site, the page isn't necessarily a finished file sent as is.This setup is useful: you modify a service in your admin area, and the site knows how to present it. But if several people view this service without it having changed, the server can end up generating a very similar response multiple times.
Varnish sits in front of the application and can store a public response to reuse it. This is known as an HTTP cache. If the available response matches the request and remains usable according to defined rules, it can be served without asking the application to rebuild everything. Otherwise, the request is passed through.
Imagine a project page showing the same photos and text to all visitors. It makes sense to prepare this response once and then reuse it. On the other hand, there is no reason to treat a client area like that public page. That is the whole difference between setting up a cache and correctly deciding what it is allowed to store.
La Varnish documentation presents the rules that drive this process. You don't need to learn their configuration language to use your site, but someone needs to understand it to operate it.
Is this enough to make the site fast?
Not necessarily. If the wait comes mainly from the server preparing pages and those pages can be shared between visitors, a cache can reduce that workload. It can also relieve the application when many people view the same public content.But a page can respond quickly and still be frustrating to use. Oversized photos, scripts that delay display, or a layout that shifts during loading don't disappear just because Varnish handled the request. The visitor's phone and connection also matter.
This is why I advise you to start by measuring the problem. Are you waiting for the first server response, the images to load, or the moment you can actually use the page? These are different types of waiting, which aren't always fixed in the same place.
If server resources are insufficient, if a database query is abnormally costly, or if an image is several megabytes, these issues must be examined. Adding a cache is no substitute for understanding why the site is performing poorly. La documentation sur les Varnish performance also details the constraints of its own operation.
For the visitor, the expected result remains simple: access information, browse your services, and contact you without unnecessary waiting. L'article sur les Core Web Vitals and site speed provides a broader perspective beyond server caching.
Your customer's basket must not become the next person's
Not all site responses are public. A basket, an invoice, a booking area, or a page after login can depend on the person viewing it. A bad caching rule can then cause more than just a display error: a response intended for one person could be given to another.The task is therefore to identify these journeys and protect them. We don't disable session and cookie precautions just to show a better cache hit rate. La documentation on caching conditions explains the role of cookies and response headers.
A page can also mix public and personal information. Techniques exist to separate certain parts, but this isn't a general permission to cache the entire page. You must understand what varies, test the rules, and know how the site behaves when this separation doesn't work as expected.
For you, this means a test shouldn't be limited to opening the homepage. You must also check the functions your business depends on: sending a form, logging in, modifying a basket, opening a booking. Speeding up the storefront while breaking the ordering process would not be progress.
And when you change a price or a service?
A cache stores a response. You must therefore plan for what happens when that response becomes outdated. Otherwise, you might correct information in your admin area only to find a visitor still sees the previous version.We can define a retention period and remove responses from the cache when the relevant content changes. Varnish documente plusieurs mécanismes d'cache invalidation. The choice depends notably on how your site publishes its content and links its pages.
An added project might, for example, modify its own page, the project list, and a block showing the latest projects. You have to think about these dependencies. Clearing only the modified page isn't always enough; clearing everything with every change can also remove much of the cache's benefit.
Before considering the installation complete, I advise you to make a real test modification, then check the result as a visitor, without being logged into the admin area. What you see with your account isn't necessarily what another person receives.
A cache helps during an incident but doesn't replace security
Varnish can, depending on its configuration and available responses, temporarily serve an old version while the application responds poorly or is slow to rebuild content. La documentation appelle cela le grace mode.This possibility applies to the content and durations we have planned for. It doesn't mean an order can be processed without the application, nor that the entire site will continue to function after any failure. Nor does it turn Varnish into complete protection against denial-of-service attacks, which seek to make a service unavailable by overloading it.
It remains necessary to monitor infrastructure, maintain components, and prepare backups. La question du cache rejoint donc celle de la site maintenance : who checks the operation, who intervenes if responses become incorrect, and who adapts the rules as the site evolves?
What I propose to look at with you
You don't need to come with a request to install Varnish. You can come with a much more concrete problem: pages take too long to open, the site slows down when you promote an offer, or certain information doesn't seem to update.From there, the work I propose consists of looking at the pages and journeys involved, measuring where the delay is, and then choosing an appropriate fix. If a cache is relevant, we must define what it can store, test personal areas, and verify that publications correctly update the responses. Then, we compare the operation before and after, instead of just settling for the presence of a new tool.
This approach can lead to using Varnish, reviewing its configuration if it's already present, or fixing another problem as a priority. The technical choice must serve your site, not the other way around. An additional component also requires maintenance; if it doesn't bring a useful benefit, there's no reason to add it just for the sake of it.
If you don't know why your site is slow or if you want to overhaul its operation before it bothers your customers, we can start by discussing it.




