Changeset 15b8017


Ignore:
Timestamp:
2006-10-10 15:36:11 (8 years ago)
Author:
Dag Erling Smørgrav <des@…>
Branches:
2.0, 2.1, tags/varnish-2.0, tags/varnish-2.0-beta1, tags/varnish-2.0-beta1@3141, tags/varnish-2.0-beta2, tags/varnish-2.0-beta2@3221, tags/varnish-2.0-rc1, tags/varnish-2.0-rc1@3266, tags/varnish-2.0-tp1, tags/varnish-2.0-tp1@2734, tags/varnish-2.0-tp2, tags/varnish-2.0-tp2@2803, tags/varnish-2.0.1, tags/varnish-2.0.2, tags/varnish-2.0.3, tags/varnish-2.0.4, tags/varnish-2.0.5, tags/varnish-2.0.6, tags/varnish-2.1.0, tags/varnish-2.1.1, tags/varnish-2.1.2, tags/varnish-2.1.3, tags/varnish-2.1.4
Children:
9377547
Parents:
c525c1f
git-author:
Dag Erling Smørgrav <des@…> (2006-10-10 15:36:11)
git-committer:
Dag Erling Smørgrav <des@…> (2006-10-10 15:36:11)
Message:

Add an example based on VG's PURGE code.

git-svn-id:  http://www.varnish-cache.org/svn/trunk@1149 d4fa192b-c00b-0410-8231-f00ffab90ce4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • man/vcl.7

    rc4b319a r15b8017  
    3535.Nm VCL 
    3636.Nd Varnish Configuration Language 
    37 .Sh SYNOPSIS 
    38 .\" ... 
    3937.Sh DESCRIPTION 
    4038The 
     
    279277} 
    280278.Ed 
     279.Pp 
     280The following code implements the HTTP PURGE method as used by Squid 
     281for object invalidation: 
     282.Bd -literal -offset 4n 
     283acl purge { 
     284        "localhost"; 
     285        "10.0.0.1"/8; 
     286} 
     287 
     288sub vcl_recv { 
     289    if (req.request == "PURGE") { 
     290        if (!client.ip ~ purge) { 
     291            error 405 "Not allowed."; 
     292        } 
     293        lookup; 
     294    } 
     295} 
     296 
     297sub vcl_hit { 
     298    if (req.request == "PURGE") { 
     299        set obj.ttl = 0s; 
     300        error 200 "Purged."; 
     301    } 
     302} 
     303 
     304sub vcl_miss { 
     305    if (req.request == "PURGE") { 
     306        error 404 "Not in cache."; 
     307    } 
     308} 
     309.Ed 
    281310.Sh SEE ALSO 
    282311.Xr varnishd 1 
Note: See TracChangeset for help on using the changeset viewer.