Varnish
Web application accelerator/caching HTTP reverse proxy.
Alternatives
Tech stack
No tech stack added yet. Sign in to suggest some
Note: We were unable to retrieve content from the official website this time. The following was written based on publicly available knowledge of Varnish Cache. For specific versions and details, please refer to the official website at https://varnish-cache.org/.
Overview
Varnish Cache is an open-source, high-performance HTTP reverse proxy cache. It sits between clients and backend web servers (such as Apache, Nginx, or various application servers). When a request comes in, if the content is already in the cache, Varnish returns it directly without contacting the backend, which significantly reduces response latency and server load. It is used by many high-traffic news, media, and e-commerce sites.
Key Features
- HTTP reverse proxy cache: Caches backend responses in memory and serves them to clients at high speed.
- VCL configuration language: Varnish Configuration Language is a purpose-built domain-specific language that gives you fine-grained control over request handling, caching policies, backend selection, header rewriting, and more. VCL is compiled into C code for execution, so the performance overhead is very low.
- Multiple backends and load balancing: You can define multiple backends and use directors for load balancing, with support for backend health checks.
- ESI (Edge Side Includes): Splits a page into separate fragments, each with its own caching policy.
- Cache invalidation: Supports purge, ban, and other methods for actively removing or invalidating cached content in bulk.
- Observability tools: Ships with command-line tools such as varnishlog, varnishstat, varnishtop, and varnishncsa for viewing real-time logs and statistics.
- Module extensions (VMOD): Extend the functionality of VCL through VMODs.
Target Users and Use Cases
- Website operators and operations engineers with heavy traffic who need to improve page response times;
- Development teams who need to speed up a CMS (such as WordPress or Drupal) or a dynamic application;
- Technical teams building their own CDN edge nodes or API caching layers.
Core Strengths
- Very high performance, with extremely fast responses on cache hits;
- Highly flexible VCL, which lets you customize almost any caching and routing logic;
- Open source (BSD license), with a mature community and plenty of documentation;
- New VCL configurations can be loaded at runtime without restarting the service.
Installation and Deployment
The package repositories of major Linux distributions generally provide Varnish packages, for example:
# Debian / Ubuntu
sudo apt install varnish
# RHEL / CentOS / Fedora
sudo dnf install varnish
You can also use the official package repositories, Docker images, or build from source. After installation, edit the default VCL file (usually /etc/varnish/default.vcl), specify the backend address, and adjust the listening port, and you are ready to go.
Technical Requirements and Notes
- Runs mainly on Unix-like systems such as Linux and FreeBSD;
- The open-source version does not handle HTTPS/TLS termination itself, so a TLS proxy (such as Hitch, Nginx, or HAProxy) is usually placed in front of it;
- The cache is stored mainly in memory, so you need to provision enough memory for your cache size;
- Commercial companies also offer enterprise products and technical support based on Varnish.
Discover more
Algernon
Small self-contained pure-Go web server with Lua, Markdown, HTTP/2, QUIC, Redis and PostgreSQL support.
Caddy
Powerful, enterprise-ready, open source web server with automatic HTTPS.
Lighttpd
Secure, fast, compliant, and very flexible web server that has been optimized for high-performance environments.
Apache HTTP Server
Secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards.
BunkerWeb
Next-gen Web Application Firewall (WAF) that will protect your web services.
HAProxy
Very fast and reliable reverse-proxy offering high availability, load balancing, and proxying for TCP and HTTP-based applications.