Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Caching Solutions:
Varnish
with Bogdan Hadadea
1. General Description: Varnish
• HTTP Accelerator
• Caching reverse proxy
o Sits in front of any HTTP server

• Load Bala...
1. General Description: Varnish
ESI – Edge Side Includes
• Allows page fragmentation
• Fragments with different TTL
• ESI ...
2. Usage: Varnish

• Originally built for Norwegian newspaper
• Current users:
o
o
o
o
o

Facebook
Twitter
Hulu
BBC
Wired
3. Architecture: Varnish - Overview
3. Architecture: Varnish
Main methods:
•
•
•
•
•

vcl_recv – beginning of request
vcl_fetch – after response from backend
...
3. Architecture: Varnish
VCL_RECV:

•
•
•
•

Manipulate/remove cookies
Manipulate/add/remove headers
Request standardizati...
3. Architecture: Varnish
VCL_FETCH
•
•
•
•
•

Enable ESI
Manipulate headers
Manipulate cookies
Vary
Set/manipulate cache t...
4. Comparison: Squid
Advantages of Squid over Varnish:
• Built in SSL support
• Better support for streaming delivery of o...
5. Conclusion

• Simple and great performance increase
• VCL is powerful but sometimes simple is better
• Make sure you ca...
Upcoming SlideShare
Loading in …5
×

Caching solutions with Varnish

765 views

Published on

Caching solutions with Varnish - presentation held by Bogdan Hadadea at Open Coffee Tech meetup

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Caching solutions with Varnish

  1. 1. Caching Solutions: Varnish with Bogdan Hadadea
  2. 2. 1. General Description: Varnish • HTTP Accelerator • Caching reverse proxy o Sits in front of any HTTP server • Load Balancer • Fail Over System • Perfect Browser caching solution o Prevents hard refresh calls • Typical speedup: 300x-1000x • VCL – compiled to C • ESI
  3. 3. 1. General Description: Varnish ESI – Edge Side Includes • Allows page fragmentation • Fragments with different TTL • ESI are serialized • Configurable depth of ESI calls • Doesn’t support alt and noerror attributes • ESI calls can’t set cookies
  4. 4. 2. Usage: Varnish • Originally built for Norwegian newspaper • Current users: o o o o o Facebook Twitter Hulu BBC Wired
  5. 5. 3. Architecture: Varnish - Overview
  6. 6. 3. Architecture: Varnish Main methods: • • • • • vcl_recv – beginning of request vcl_fetch – after response from backend vcl_hash – how to create a hash key vcl_deliver – before a cached object is delivered vcl_error – when there is an error
  7. 7. 3. Architecture: Varnish VCL_RECV: • • • • Manipulate/remove cookies Manipulate/add/remove headers Request standardization Cache bypassing
  8. 8. 3. Architecture: Varnish VCL_FETCH • • • • • Enable ESI Manipulate headers Manipulate cookies Vary Set/manipulate cache times
  9. 9. 4. Comparison: Squid Advantages of Squid over Varnish: • Built in SSL support • Better support for streaming delivery of objects • Support for antivirus plugins Advantages of Varnish over Squid: • Amazing configuration system – VCL • Better performance and scalability • Better invalidation support • Better module support
  10. 10. 5. Conclusion • Simple and great performance increase • VCL is powerful but sometimes simple is better • Make sure you can still handle a cold start

×