Hi Andrea.

On Dec 4, 2012, at 6:08 AM, Andrea Campi 
<[email protected]<mailto:[email protected]>>
 wrote:


On Tue, Dec 4, 2012 at 2:42 AM, Marcos Paulo Hack 
<[email protected]<mailto:[email protected]>> wrote:
Hi Andrea.

As discussed in IRC channel, the grace mode should be used to implement the 
stale-while-revalidate directive, but there is no easy (or even viable) way to 
implement stale-if-error using VLC.

Do logs exist for that conversation? I would be interested in the rationale for 
that.

I couldn't find the channel log anywhere so I attached here.

At face value it sounds like a useful implementation of stale-if-error can be 
done in VCL using saint mode.

Other than that, I'll probably end up doing a VMOD anyway.

The only problem with stale-while-revalidate using grace mode is that it isn't 
really asynchronous as discussed here [1]. So a VMOD implementation should be 
required to be full compliance with the RFC.


Looking at the RFC some more, I have some questions. I'll probably get in touch 
with the editor of the RFC:

* I am unclear on whether this is intended for reverse proxies that can be 
considered "part of the application" or if remote proxies and user agents are 
allowed to use it too.
The use of Cache-Control suggest the latter, but in that case I would like to 
see an implementation in a browser before I start sending these headers out in 
the wild. I realize user agents are free to show stale content anyway, but they 
usually don't.
Vice versa, it looks like these extensions may be useful also in 
Surrogate-Control, where we can easily ensure they never make it past Varnish.

* I don't like stale-if-error in a request. I won't comment on its useful from 
the point of view of the user agent (other than saying it would make for a 
complex UI).
But from the point of view of Varnish, the only useful use case I can see is 
*reducing* the allowed staleness�since by definition it can't make it any 
longer than the time the object persists in the cache.
If I were to implement this, I would just ignore this in requests.

Thoughts? I'll probably start working on this and edge-arch over the next week, 
so any reasoned opinion is appreciated as it may very well save me time ;)

Good questions. You should talk to Mark Nottingham, indeed.

Just a side note: the folks of Traffic Server just finished their experimental 
implementation a month ago, maybe you can find some useful insights over there 
;)

[1] 
https://www.varnish-cache.org/lists/pipermail/varnish-misc/2012-March/021800.html
[2] 
https://github.com/apache/trafficserver/tree/master/plugins/experimental/rfc5861

Regards.
Marcos



AVISO LEGAL: Esta mensagem e arquivos podem conter informacoes confidenciais e 
ou legalmente protegidas. 
Caso tenha recebido por engano, favor devolve-la ao remetente e elimina-la do 
seu sistema, nao divulgando ou utilizando a totalidade ou parte desta mensagem 
ou dos documentos a ela anexados.

[2012-12-03 16:30 -02:00] You have joined the channel
[2012-12-03 16:30 -02:00] Topic: Varnish 3.0.3 released .:. please supply VCL 
and varnishlog output with help requests
[2012-12-03 16:30 -02:00] DocWilco set the topic at: Oct 31, 2012 6:06 PM
[2012-12-03 16:30 -02:00] Mode: +nrt
[2012-12-03 16:30 -02:00] Created at: Jun 17, 2011 3:53 PM
[2012-12-03 16:31 -02:00] mhack: Hello. Is there any working in progress or 
intention to implement RFC 5861 (stale-*) cache-control extensions?
[2012-12-03 17:20 -02:00] packbart: mhack: shouldn't that already be possible 
with VCL and grace?
[2012-12-03 17:24 -02:00] packbart: stale-if-error might be a bit tricky, though
[2012-12-03 17:48 -02:00] mhack: packbart: yes, that's possible to use grace 
mode, but don't you think that giving control for the underling origin server 
to manage those directives through cache-control header could be interesting in 
some cases?
[2012-12-03 17:48 -02:00] packbart: yes. what I meant: you can already set 
beresp.grace from stale-while-revalidate
[2012-12-03 17:49 -02:00] packbart: in vcl_fetch
[2012-12-03 17:51 -02:00] mhack: sure. but my point is that for scenarios with 
many different resources requiring specific stale-* configuration it could be 
hard to manage.
[2012-12-03 17:51 -02:00] packbart: hmm. I don't quite follow. see 
https://github.com/lampeh/varnish-vcl/blob/master/common/ttl_v-maxage.vcl 
(although that sets beresp.ttl from v-maxage)
[2012-12-03 17:54 -02:00] packbart: replace beresp.ttl with beresp.grace and 
v-maxage with stale-while-revalidate
[2012-12-03 17:56 -02:00] mhack: oh, sure.. got it. my mistake :)
[2012-12-03 17:57 -02:00] mhack: but there is no simple solution for 
stale-if-error, right?
[2012-12-03 17:58 -02:00] mhack: but is it possible anyway?
[2012-12-03 17:58 -02:00] packbart: not that I can see. vcl_fetch would have to 
access a second object, the possible stale cache hit. and it might be already 
beyond its grace time.
[2012-12-03 18:00 -02:00] packbart: possibly set beresp.grace to stale-if-error 
and compare TTL agains stale-while-revalidate in vcl_deliver and restart/launch 
background fetch. but that even sounds nasty
[2012-12-03 18:45 -02:00] mhack: packbart: understood. well, so I can see that 
a "real" compliance with RFC 5861 isn't in the development horizon, right?
[2012-12-03 18:46 -02:00] andersm_: mhack: throw enough money at Varnish 
Software and it will be. =)
[2012-12-03 18:46 -02:00] mhack: andersm_: well, that whould be the next 
question :)
[2012-12-03 18:48 -02:00] mhack: we have varnish commercial support contract, 
and I asked our infrastructure team to talk about that with you, but they're 
taking a while to do that.. lol
[2012-12-03 18:48 -02:00] Mithrandir: yeah, you can kinda do it today, but it's 
not currently a priority.
[2012-12-03 18:48 -02:00] Mithrandir: mhack: if you can say, who are "we"? :-)
[2012-12-03 18:48 -02:00] mhack: Editora Abril
[2012-12-03 18:48 -02:00] mhack: from Brazil
[2012-12-03 18:48 -02:00] Mithrandir: ah. :-)
[2012-12-03 18:48 -02:00] Mithrandir: pleased to meet you
[2012-12-03 18:49 -02:00] Mithrandir: (jftr, I'm tech lead at Varnish Software, 
responsible for our support operations)
[2012-12-03 18:49 -02:00] mhack: cool. nice to meet you too
[2012-12-03 18:49 -02:00] mhack: did you guys received any question about that 
from our team?
[2012-12-03 18:49 -02:00] Mithrandir: I can't say I remember seeing it.
[2012-12-03 18:50 -02:00] mhack: no problem
[2012-12-03 18:50 -02:00] Mithrandir: but if you mail me 
([email protected]), I'll follow up.
[2012-12-03 18:50 -02:00] Mithrandir: (it's close to ten in the evening here 
now, so I'm not actually working. :-)
[2012-12-03 18:51 -02:00] mhack: sure. I'm going home as well, almost 7pm over 
here :)
[2012-12-03 18:51 -02:00] Mithrandir: :-)
[2012-12-03 18:51 -02:00] mhack: I'll contact you to in the next fell days to 
talk about it, so.
[2012-12-03 18:52 -02:00] mhack: thank you very much.
[2012-12-03 18:52 -02:00] mhack: few days
[2012-12-03 18:52 -02:00] mhack: :)
[2012-12-03 18:52 -02:00] andersm_: I'm not affiliated with Varnish Software in 
any way, but I would heartily recommend throwing money at them anyway. Not that 
I've gotten my employer to do so yet, but it is likely that we will some day. 
Hell, we ought to pay them for hanging out here. =]
[2012-12-03 18:52 -02:00] Mithrandir: mhack: great, looking forward to it. :-)
[2012-12-03 18:54 -02:00] mhack: andersm_: sure we do. It's a really nice piece 
of work.
[2012-12-03 18:55 -02:00] mhack: see you guys.
_______________________________________________
varnish-dev mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev

Reply via email to