Purge

Poul-Henning Kamp phk at phk.freebsd.dk
Thu Jul 20 22:39:49 CEST 2006


In message <1201.193.69.165.4.1153427528.squirrel at denise.vg.no>, "Anders Berg" 
writes:

>Poul-Henning told me (in irc before he timed-out) that it would not take
>long to implement either TTL per URL or PURGE in VCL.

Yes.

Setting the TTL would be something as simple as:

	sub vcl_fetch {
		if (req.url = "/") {
			obj.ttl = 120;
		}
	}

(Not sure if the vcl runtime actually allows this yet)

Purge is slightly different, we can do it two ways:  Accept "PURGE"
in vcl_recv();  If we see it again in vcl_miss() return a 404.
If we get to vcl_hit() set the obj.ttl to zero and return a suitable
status code.

Or alternatively implement in C that PURGE will do a regexp ban,
and allow PURGE only from localhost in the default vcl_recv().  Of
course that means that the argument _is_ a regexp, so "PURGE / HTTP/1.1"
is not the right thing to send :-)

>I think we should implement just that (either 2, or both). That way we can
>test that part of VCL in the livetesting we are doing.

I've started on the last nasty bit of the HTTP header
storage/editing/munging stuff, and I would like to get that done
first, but I'll do whichever of the other two you want
afterwards.

>Some FUD developed today when our frontpage editors sensed that their
>Purge tool did not function correctly :) Sorry about that, and the
>following phonecalls.

No worries, afterall, we _did_ find a bug in Varnish expiry today.

Poul-Henning

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



More information about the varnish-dev mailing list