HTTP Accelerator Cache: Varnish

The Varnish is an open-source reverse proxy server. Its primary purpose is to cache HTTP responses. Besides it also enables modifying HTTP requests/ response to the origin.

The Varnish documentation highlights that the server is highly scalable on a multi-core system, efficient (uses mostly kernel services such as kqueue, epoll, memory management). It’s developed in C.

The reverse proxy sits between the client (browser) and the server (origin).

It has a few interesting use cases such as:

  • Modifying cookies in the request
  • Appending/removing headers in request/response (e.g. changing Host header)
  • Prevents Cache Stampede (on a miss, many fetches won’t cause many reads from the origin). It uses TTL + Grace period for cached objects. After TTL is expired, Varnish fetches the object asynchronously.

References

Written with StackEdit.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: