Loading...

Varnish - HTTP Accelerator Crash Course

704 views

Loading...

Loading...

Transcript

The interactive transcript could not be loaded.

Loading...

Rating is available when the video has been rented.
This feature is not available right now. Please try again later.
Published on Dec 10, 2019

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=GTeCt...
Layer 4 vs Layer 7 Load balancing 6:25 https://www.youtube.com/watch?v=aKMLg...
GET vs POST 6:48 https://www.youtube.com/watch?v=K8HJ6...
Postgres NodeJS Chrome 8:23 https://www.youtube.com/watch?v=0JNq4...
Redis 46:13 https://www.youtube.com/watch?v=sVCZo...
TLS Termination 49:35 https://www.youtube.com/watch?v=H0bkL...


Resources
edge side includes
https://www.fastly.com/blog/using-esi...
Cache invalidation varnish
https://www.smashingmagazine.com/2014...
Varnish Doc
https://varnish-cache.org/docs/

🏭 Software Architecture Videos
https://www.youtube.com/playlist?list...

💾 Database Engineering Videos
https://www.youtube.com/playlist?list...

🛰 Network Engineering Videos
https://www.youtube.com/playlist?list...

🏰 Load Balancing and Proxies Videos
https://www.youtube.com/playlist?list...

🐘 Postgres Videos
https://www.youtube.com/playlist?list...

🧮 Programming Pattern Videos
https://www.youtube.com/playlist?list...

🛡 Web Security Videos
https://www.youtube.com/playlist?list...

🦠 HTTP Videos
https://www.youtube.com/playlist?list...


🐍 Python Videos
https://www.youtube.com/playlist?list...

🔆 Javascript Videos
https://www.youtube.com/playlist?list...

Support me on PayPal
https://bit.ly/33ENps4

Become a Patreon
https://www.patreon.com/join/hnasr?

Stay Awesome,
Hussein

Loading...

Advertisement

to add this to Watch Later

Add to

Loading playlists...