How it works - Varnish Software

How it works

Varnish Software’s content delivery solutions are all built on top of Varnish, a uniquely powerful caching technology.

Many of the world’s biggest and most popular brands rely on Varnish for delivering their digital content at optimal speed and scalability.

Using Varnish solutions you can take back control of how, when, where and to whom you deliver your digital content while reducing traffic load on the backend.

Origin server
Putting a proxy in front of your origin servers protects the backend from flooding and lets the cache do the heavy lifting.
Varnish cache server
Caching with Varnish enables 300% to 1000% faster content delivery, and reduces backend server load by up to 89% while handling unlimited simultaneous visitors.
Varnish ensures speedy, responsive content delivery optimized by device type. Serving content quickly and efficiently doesn’t just mean you can serve more users, it also gives them faster downloads and a better experience.

API and Web Acceleration

Heavy or unpredictable traffic slows down performance, and built-in caching features don’t keep up.

The caching power of Varnish API and Web Acceleration ensures scalable, high-performance content delivery for anything HTTP and most API protocols.

Whether serving static files or, in particular, complex, dynamic content where speed is essential, Varnish API and Web Acceleration delivers.

Learn what Varnish API and Web Acceleration can do.

Origin server
Let your origin do what it’s good at: ingesting, mix and packaging, while Varnish does the heavy lifting, as it’s compatible with all the major video formats (HLS, HSS, HDS, etc.).
Varnish cache server
Thanks to MSE, Varnish can store huge volumes of video as origin shield, making sure requests go to the origin only when absolutely necessary.
Cloud server
Place the video caching edge close to your user, be it live, VoD or catch-up to ensure minimal startup time for your customer.
Varnish ensures speedy, responsive content delivery optimized by device type. Serving content quickly and efficiently doesn’t just mean you can serve more users, it also gives them faster downloads and a better experience.

Streaming Server

Media streaming is unpredictable. Instant HTTP live or on-demand streaming at scale to unpredictable audiences on multiple devices poses challenges in developing the right infrastructure to handle and adapt to the conditions at hand.

The Varnish Streaming Server can help deliver on your live, OTT and VoD streaming needs at any scale.

Helping you plan and size your platform and ready your infrastructure for whatever streaming traffic hits, Varnish ensures that your audiences will need only to push play for a seamless streaming experience.

Learn what Varnish Streaming Server can do.

Origin server
Deploying origin servers in multiple locations may cause a lot of headaches because of replication and synchronization. With Varnish you can reach customers all over the world without multiplying your origins.
Varnish cache server
As the brain of your setup, your origin needs to be accessible globally by the edge server, and it must be protected from abuse.
Varnish is easy and quick to deploy, hence it can easily be deployed anywhere in the world. In the cloud, virtualized, containerized or on bare metal, put Varnish close to your user to reduce latency.


As companies aim to tailor their specific performance and content delivery needs as well as control costs, content and privacy, moving away from commercial CDNs, over which they have very little control, the alternative – do-it-yourself CDNs – become a viable and flexible option.

The Varnish DIY CDN solution lets companies build their own in-house private CDNs, hybrid CDNs, consumer CDNs, and advanced edge platforms.

With the cloud and standard components, and the flexibility of the Varnish DIY CDN solution, a high-performance, global CDN that meets your specific needs can be built in as little as one afternoon.

Learn what Varnish DIY CDN can do.

Does it work with…

Compatibility is key. Varnish is architecture-agnostic, caching virtually any kind of content and supporting the world’s most-used web technologies. Read up on a few of the most common CMSes, e-commerce platforms, CDNs and others that Varnish supports:

Get in touch if you have questions about all the rest.

We are serious about security

Staying ahead of security threats is a tough job, but one we’re committed to. We’re always working to stay ahead of the next major security issue and keep you protected.


Varnish Total Encryption

Securely encrypts all cached data using dual-key AES 256 encryption, giving each cached object its own unique key. Using this solution you can ensure any leaked or hacked data is rendered inaccessible.


Varnish as a firewall

The Varnish Web Application Firewall (WAF) lets you inspect your HTTP traffic and detect malicious requests at the edge before they reach your web application.


Varnish HTTPS support

SSL/TLS (HTTPS) encryption is, by now, a requirement for security, privacy and even SEO. The General Data Protection Regulation (GDPR) also highly recommends encryption of data wherever possible. With Varnish, you can protect your client-side and backend.

Under the hood

Showing and telling are two different things.
What does Varnish look like in action?


This VCL snippet strips all the cookies that should not be kept.

We want to keep certain cookies if the req.url matches a specific condition, otherwise we will just remove all the other cookie headers.

Pre-fetch with vmod-http

Here we use a combination of vmod_kvstore (key value storage) and vmod_http (external requests).

Using these together we can prefetch content in a live streaming scenario and pace the background fetches triggered by vmod_http.

We use a “counter” function to make sure a single URL per second can trigger a prefetch request. This is to avoid overwhelming our backends. Without that counter we would push 10,000 prefetch requests to the backend.


For each incoming request we buffer the request body and try to parse it, assuming it is in JSON format.

If it is in JSON format, we extrapolate the value associated to the key “authorization”.
This is a good way to run a check on your request bodies and extend your authorization control.


Vmod-rewrite does Apache-style rewrite rules. It aims to reduce the amount of VCL to be written when many rewrites or manipulations need to be applied to URLs or headers.

A path to a file containing the rules must be specified and these will be applied at run time to every incoming request.

Oh yes, Varnish comes with a dashboard…

…and an admin console to keep your eyes on what Varnish is doing in real time. Curious to take a look?

Check out the VAC Demo

Ready for more?

Get up to speed with Varnish Software. Learn more about optimizing API and web performance and content delivery as well as taking control of your web content and how, where, when and to whom it’s delivered.

Book a meeting

Curious to find out more about our solutions? Schedule a meeting with our sales department.


Talk to us

Estimate pricing

In the market for Varnish? Get a price estimate right away using our estimation tool.



Talk to a customer engineer

Varnish experts are on hand to answer your technical questions and help you find the solution you need.


Contact us

Request a free trial