<div dir="ltr">Hi,<br><br>Attached is an updated patch for s-w-r support that I originally sent in June 23.<br>I've kept the code outside RFC2616_Ttl but still adding it into rfc2616_cache.c.<br>It might be worth merging it and/or moving this into rfc5861_cache.c.<br>
<br>Before this turns into another bike-shedding, a few things worth clarifying:<br><br>It only implements stale-while-revalidate as the subject says.<br>Implementing stale-if-error requires more changes to Varnish and while it might be implemented in the future is not in the scope of this patch.<br>
I rather have something that people can use now that nothing at all for a longer period (this diff was sent over 2 months ago).<br><br>If ttl is equal or lower than 0 this implementation will ignore the stale-while-revalidate value. There are 2 reasons for this that are not related to this diff but to Varnish itself: 1. Varnish won't cache an object with a 0 ttl and 2. a ttl of -1 indicates that either the response status was uncacheable (as per RFC2616_Ttl) or that the content already expired (again based on RFC2616_Ttl).<br>
Should the situation in Varnish change it's as simple of modifying the check to be `expp->ttl < 0.' so I'd prefer to have that discussion decoupled from this patch.<br><br>Thanks.<br></div>