Purging. Now what?

Anders Berg andersb at vgnett.no
Mon Nov 13 21:53:39 CET 2006


Hi Gaute,

and thanks for the script examples in earlier posts.

With regards to your question about purging I must admit that I am  
unsure what you are trying to achieve. Could we be talking corner  
case here?
I will try to explain why and how purging is used in general, so  
please don't be offended if I state the obvious or can't see your  
challange or what I am saying is to trivial.

Purging is not used to control content expiration, the HTTP headers  
like Expires and max-age etc. do that. Purging is used as a "oh-shit- 
have-to-delete-now" mechanism. Let's say you have a default cache  
time for your article/page on 5 min., but 5 min. is to long to wait  
for a update if there is important stuff that needs to replace the  
content in the cache. That's when you would use purging to "force" an  
update on that/those page(s). If it's only one page, go directly for  
that page (no reg-exp), if there are more that one you have to keep  
control over what pages need to be refreshed or use a URL schema so  
that a reg-exp purge will delete them.

Does this answer your question? Please explain a bit deeper, with  
examples, if this does not.

Anders Berg
Sys.adm
VG Nett // www.vg.no


> Date: Sun, 12 Nov 2006 16:47:52 +0100
> From: Gaute Amundsen <gaute at pht.no>
> Subject: Purging. Now what?
> To: varnish-misc at projects.linpro.no
> Message-ID: <200611121647.54547.gaute at pht.no>
> Content-Type: text/plain;  charset="iso-8859-1"
>
> Now that I can trigger a purge when a customer presses "save" in  
> our CMS, the
> next step is trying to do it somewhat smarter...
>
> Purging everything from all hosts in the cache is simple via  
> telnet, but a bit
> brutish. It could get noticable as well, with maybe 50 customers  
> saving
> through the day..
>
> Purging one url at a time is more presice, but then I have to keep  
> track of
> what to purge. Finding all urls in a site is not very efficient,  
> and 95% of
> those would not be in the cache  anyway.
>
> I could build a small daemon to tail the access logs, and keep a  
> running
> buffer of recently accessed pages. Then I could easily prefetch  
> pages as
> well, after purging them. But it does not feel quite right this  
> either...
> Sort of buliding a shadow copy of varnish timeout mechanism.
>
> Any good suggestions?
>
> Regards
> Gaute Amundsen



More information about the varnish-misc mailing list