|Version 29 (modified by kane, 5 years ago) (diff)|
Please feel free to add your useful VCL snippets to the page.
This page holds (links to) useful VCL examples.
- The Default VCL with examples and a graphical overview of how a request goes through all the VCL hooks.
- Purging (also see the FAQ?)
- Using restarts to try multiple backends
- Using directors for load balancing
- Caching even when cookies are present
- How to cache things longer on Varnish than the client
- Removing some, but not all cookies
- Enable force-refresh from clients
- Redirect using VCL
- How to ignore cache headers from the backend
- Log to syslog using VCL and embedded C
- Useful bits if you are using pipe
- Adding a header indicating hit/miss & extended diagnostics
- Grace - Handling backend failures and expired objects gracefully
- Saint Mode - Holding off backend requests for a specific object for a while
VCL Real World Examples
Below are full VCL's used already in live production systems.
These should only be used as a reference to help build your own VCL!
Manually maintained syntax description of VCL
- Varnish 1.1 source:branches/1.1/lib/libvcl/syntax.txt
- Varnish 1.2 source:branches/1.2/lib/libvcl/syntax.txt
Note: This document has been removed from trunk (which has a number of VclSyntaxChanges?).