<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Dec 4, 2012 at 1:58 PM, Marcos Paulo Hack <span dir="ltr"><<a href="mailto:marcos.hack@abril.com.br" target="_blank">marcos.hack@abril.com.br</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">



<div>
<div style="word-wrap:break-word">
<div>Hi Andrea.</div>
<div><br>
<div>
<div>On Dec 4, 2012, at 6:08 AM, Andrea Campi <<a href="mailto:andrea.campi@zephirworks.com" target="_blank">andrea.campi@zephirworks.com</a>></div>
<div> wrote:</div><div class="im">
<blockquote type="cite">
<div>At face value it sounds like a useful implementation of stale-if-error can be done in VCL using saint mode.</div>
<div><br>
</div>
<div>Other than that, I'll probably end up doing a VMOD anyway.</div>
</blockquote>
<div><br>
</div>
</div><div>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.</div>

</div></div></div></div></blockquote><div><br></div><div><br></div><div>The RFC does say:</div><div><br></div><div><pre class="" style="font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)">indicates that it is fresh for 600 seconds, and it may continue to be
   served stale for up to an additional 30 seconds while an asynchronous
   validation is attempted. </pre><pre class="" style="font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"><br></pre><pre class="" style="font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif">However later on:</font></pre>

<pre class="" style="font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif"><br></font></pre><pre class="" style="font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)">

<pre class="" style="font-size:1em;margin-top:0px;margin-bottom:0px">   Since asynchronous validation will only happen if a request occurs
   after the response has become stale, but before the end of the stale-
   while-revalidate window, the size of that window and the likelihood
   of a request during it determines how likely it is that all requests
   will be served without delay.  If the window is too small, or traffic
   is too sparse, some requests will fall outside of it, and block until
   the server can validate the cached response.
</pre><div><br></div><div><font face="arial, helvetica, sans-serif">The way I read this is that the RFC doesn't concern itself with telling us that we *must* make an asynchronous request.</font></div><div><font face="arial, helvetica, sans-serif">Instead, the assumed goal is to allow as many requests as possible to continue unimpeded.</font></div>

<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Let me turn this around: I'm not going to attempt to change the architecture of Varnish to do asynchronous background requests.</font></div>

<div><font face="arial, helvetica, sans-serif">Given that, would implementing the RFC still be useful?</font></div><div><font face="arial, helvetica, sans-serif">I think so, because it allows us to push responsibility for deciding how much grace to apply to an object out of the VCL and into the bbackend, where it belongs.</font></div>

<div><font face="arial, helvetica, sans-serif">Would such an implementation still conform to the RFC? I think so. If you tested this as a blackbox, all you would see if that one request will take longer, but other than that it would work as expected.</font></div>

<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Besides, when in doubt between perfect compliance with a standard some day in the future, or a 90% implementation that solves a real problem today, I'll pick the latter any day and twice on Sundays ;)</font></div>

<div></div></pre></div></div></div><div class="gmail_extra"><br></div><div class="gmail_extra">Andrea</div>