Changeset 4435 for trunk/varnish-cache/man
- Timestamp:
- 01/08/10 10:13:17 (7 months ago)
- Files:
-
- 1 modified
-
trunk/varnish-cache/man/vcl.7so (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/varnish-cache/man/vcl.7so
r4421 r4435 283 283 Subroutines in VCL do not take arguments, nor do they return values. 284 284 .Pp 285 If multiple subroutines with the same name are defined, they are286 concatenated in the order in which the appear in the source.287 .Pp288 285 To call a subroutine, use the 289 286 .Cm call … … 468 465 .Sx EXAMPLES 469 466 section for a listing of the default code. 467 .Ss Multiple subroutines 468 If multiple subroutines with the same name are defined, they are 469 concatenated in the order in which the appear in the source. 470 .Pp 471 Example: 472 .Bd -literal -offset 4n 473 # in file "main.vcl" 474 include "backends.vcl"; 475 include "purge.vcl"; 476 477 # in file "backends.vcl" 478 sub vcl_recv { 479 if (req.http.host ~ "example.com") { 480 set req.backend = foo; 481 } elsif (req.http.host ~ "example.org") { 482 set req.backend = bar; 483 } 484 } 485 486 # in file "purge.vcl" 487 sub vcl_recv { 488 if (client.ip ~ admin_network) { 489 if (req.http.Cache-Control ~ "no-cache") { 490 purge_url(req.url); 491 } 492 } 493 } 494 .Ed 495 .Pp 496 The builtin default subroutines are implicitly appended in this way. 470 497 .Ss Variables 471 498 Although subroutines take no arguments, the necessary information is
