16. Step 1: Pass through only
● Passive Varnish
○
return(pass) in vcl_recv
● Powerful load balancing
● Health checks built in
● Excellent for debugging webapps
24. Step 4: Semi-static
content caching
● Dynamically rendered content
● Expensive to render
● Almost never changes
● Set short TTL (10-120 seconds)
● Mitigates traffic peaks
25. Step 4: Semi static (2/2)
● Manual cache expiry
● Magic URLs
● Shift-refresh from special IP-range
● Web interface for ban or purge
27. Step 5: Autopurge
● Backend generates purge requests
● Set TTL to ~forever
● Invalidate on change
● Can be difficult for composite pages
○
Map relationships between data and pages
28. Step 6: Grace mode
Difficulty level: Easy
Payoff: High
29.
30. Step 6: Grace mode
•
Originally developed to mitigate pile-ups
•
Can serve “graced” content when fresh content
is unavailable
•
Unavailable means
•
•
backend down
object busy
31. Grace mode (2)
•
Both req.grace and beresp.grace must accept
the old object
•
Tip: Set req.grace to 10s normally and 1 hour
when backend is down
33. Edge Side Includes (ESI)
Horrible Designed News Site Blah
Article
snippet 1
Welcome, Foobar (logout)
Article
snippet 2
Top 10 popular news items
Article
snippet 3
Article
snippet 4
34. Edge Side Includes (ESI)
TTL: 1800minutes
TTL: 30min
TTL: 60min, user specific
TTL: 30min
TTL: 1min
TTL: 30min
TTL: 30min
35. Step 7: Content
composition
● Edge Side Includes (ESI)
● Split web pages into pieces
○
Individual caching policies
○
One piece = one URL
● Live stitching of content
● Works with compressed content as well
37. Step 8: Advanced cache
invalidation
Difficulty level: Hard
Payoff: High
38. Step 8: Advanced cache
invalidation
● Sometimes a page relies on multiple “objects” for
invalidation
● Finding out what object need to expire what pages can
be hard
● Typically a problem in e-commerce and media
39. Advanced cache
invalidation (2/2)
● Tag pages with custom headers
○
X-Skus: 49834, 34321, 4343
● Execute with bans or hashninja
● Possible database driven expiry (triggers)
40. Conclusions
● High rewards with little work
● 3 - 15 days to reach “high” payoff
● Requires backend knowledge to do significant
changes
● We talked about what to do - if you want to learn
more about how please read the book or sign up
for training.