The Backend Engineering Show with Hussein Nasser

Episode 115 - Varnish HTTP Accelerator


Listen Later

Varnish is a reverse proxy web accelerator  Written in C designed to improve HTTP performance by using server side caching.
In this video I’m going to go through how Varnish works, we will spin up a Varnish docker container and finally talk about the pros and cons of this tech.
Agenda
Classic HTTP Architecture
How Varnish Works?
HTTP Setup - Varnish
HTTPS Setup - Varnish with Caddy as TLS Terminator.
Varnish Pros & Cons
Summary
Pros
Cache & prefetching documents
Resolve DNS hostnames in documents
Rewrite scripts to optimize code
Load Balancing
Backend Connection Pooling
Varnish Modules (VMODS, e.g. rewrite headers)
Edge side includes (personalized dynamic page)
Cons
Cache Invalidation
Only works on unencrypted HTTP
For HTTPS frontend, terminate TLS
For HTTPS backend, no solution in Varnish open source
Can’t cache POST requests (e.g. GraphQL queries)
HTTP/2 backends won’t benefit
docker commands
docker run --name varnish -p 8080:80 varnish
docker cp default.vcl varnish:/etc/varnish
default.vcl
vcl 4.0;
backend default {
.host = "husseinmac";
.port = "2015";
}
timecodes
Classic HTTP Architecture : 1:53
How Varnish Works 3:50
Demo HTTP 7:50
Demo HTTPS 18:23
Varnish Pros 28:43
Varnish Cons 39:26
Cards:
Connection Pooling 2:15 https://www.youtube.com/watch?v=GTeCtIoV2Tw
Layer 4 vs Layer 7 Load balancing 6:25 https://www.youtube.com/watch?v=aKMLgFVxZYk
GET vs POST 6:48 https://www.youtube.com/watch?v=K8HJ6DN23zI
Postgres NodeJS Chrome 8:23 https://www.youtube.com/watch?v=0JNq46eFuOM
Redis 46:13 https://www.youtube.com/watch?v=sVCZo5B8ghE
TLS Termination 49:35 https://www.youtube.com/watch?v=H0bkLsUe3no
tags:
varnish http accelerator, varnish pros and cons, varnish with https, varnish disadvantages
Resources
edge side includes
https://www.fastly.com/blog/using-esi-part-1-simple-edge-side-include
Cache invalidation varnish
https://www.smashingmagazine.com/2014/04/cache-invalidation-strategies-with-varnish-cache/
——
...more
View all episodesView all episodes
Download on the App Store

The Backend Engineering Show with Hussein NasserBy Hussein Nasser

  • 4.9
  • 4.9
  • 4.9
  • 4.9
  • 4.9

4.9

40 ratings


More shows like The Backend Engineering Show with Hussein Nasser

View all
Freakonomics Radio by Freakonomics Radio + Stitcher

Freakonomics Radio

32,263 Listeners

Software Engineering Radio - the podcast for professional software developers by team@se-radio.net (SE-Radio Team)

Software Engineering Radio - the podcast for professional software developers

273 Listeners

Risky Business by Patrick Gray

Risky Business

373 Listeners

Science Vs by Spotify Studios

Science Vs

12,166 Listeners

Syntax - Tasty Web Development Treats by Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

Syntax - Tasty Web Development Treats

990 Listeners

Darknet Diaries by Jack Rhysider

Darknet Diaries

8,110 Listeners

Practical AI by Practical AI LLC

Practical AI

212 Listeners

Within Reason by Alex J O'Connor

Within Reason

1,659 Listeners

All-In with Chamath, Jason, Sacks & Friedberg by All-In Podcast, LLC

All-In with Chamath, Jason, Sacks & Friedberg

10,231 Listeners

Dwarkesh Podcast by Dwarkesh Patel

Dwarkesh Podcast

548 Listeners

Big Technology Podcast by Alex Kantrowitz

Big Technology Podcast

514 Listeners

Hard Fork by The New York Times

Hard Fork

5,544 Listeners

The AI Daily Brief: Artificial Intelligence News and Analysis by Nathaniel Whittemore

The AI Daily Brief: Artificial Intelligence News and Analysis

659 Listeners

Prof G Markets by Vox Media Podcast Network

Prof G Markets

1,471 Listeners

The Pragmatic Engineer by Gergely Orosz

The Pragmatic Engineer

74 Listeners