Search

Building your own CDN with Varnish

Building your own CDN with Varnish

Varnish is most often presented as a caching proxy that you put in front of your web servers to protect them from excessive load.

In some cases Varnish is installed on the same machine as the web server. In other cases, Varnish is installed on one or more separate machines.

In both situations Varnish is put as close as possible to the origin. While this works well for many websites and other HTTP-based platforms, it is not always the best course of action.

When we talk about content delivery and web acceleration, our responsibilities are twofold:

  • Platform stability
  • Quality of experience for the user

Platform stability is quite straightforward: the caching capabilities of Varnish allow it to serve as an origin shield.

The quality of experience we strive for, often measured through latency and throughput, is not only achieved by caching: connectivity also plays a big part in this.

When network latency increases because of network limitations or the geographical location of the user, it makes sense to put a cached version of the content as close to the user as possible. The caching itself will ensure constant throughput at scale. This is what content delivery networks (CDNs) are built for, and what this chapter is all about.

In this chapter, we will explain why Varnish is excellent CDN software, and how you can build your own CDN using both Varnish Cache and Varnish Enterprise.


®Varnish Software, Wallingatan 12, 111 60 Stockholm, Organization nr. 556805-6203