<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p style="font-size:12.8px"><tt>Hi,</tt><tt><br>
</tt><tt><br>
</tt><tt>We are implementing an stale-while-revalidate webserver
cluster with NGINX. </tt><tt><br>
</tt><tt><br>
</tt><tt>We are using the new proxy_cache_background_update to
answer request as soon as possible while NGINX updates the
content from the origin in the background. This solution works
perfectly when the requests for the same object are served by
the same NGINX server (when we have only one server or when we
have a previous load balancer that classifies the requests). </tt><tt><br>
</tt><tt><br>
</tt><tt>In our scenario we have a round robin load balancer (ELB)
and we need to scale the webservers layer. So, as a consequence,
only the Nginx that receive the request updates the cache
content while the others keep the old version. This means that,
we can send old versions of content due to the content not being
updated on all the webservers. The problem accentuates when we
put a CDN in front of the webservers.</tt><tt><br>
</tt><tt><br>
</tt><tt><span style="font-size:12.8px">We are thinking on
developing something that once an Nginx instance updates its
cache would let know all other instances to get a copy of the
newest content. We are thinking about processing NGINX logs
and, when it detects a MISS, EXPIRED or UPDATING cache status,
it makes a HEAD request to the other NGINXs on the cluster to
force the invalidation of this content.</span></tt><tt><br>
</tt></p>
<p style="font-size:12.8px"><tt><br>
</tt><tt>Do any of you have dealt with this problem or a similar
one?</tt><tt><br>
</tt><tt><br>
</tt></p>
<p style="font-size:12.8px"><tt>We have also tried the post_action
but it is blocking the client request until it completes. It is
not clear for us which would be the best approach. The options
that we are considering are:</tt><tt><br>
</tt><tt><br>
</tt><tt>- NGINX module</tt><tt><br>
</tt><tt>- LUA script</tt><tt><br>
</tt><tt>- External script that process syslog entries from NGINX</tt><tt><br>
</tt><tt><br>
</tt><tt>What would be your recommendation?</tt><tt><br>
</tt><tt><br>
</tt></p>
<tt>Many thanks in advance,</tt><span class="gmail-HOEnZb"><font
color="#888888"><br>
<br>
<br>
</font></span>
<div class="moz-signature">-- <br>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Joan Tomàs-Buliart</title>
<div align="left"><a href="http://www.marfeel.com"><img
alt="www.marfeel.com" title="www.marfeel.com"
src="cid:part1.479F6270.CBB4F497@marfeel.com" class=""
width="284" border="0" height="44"></a><br>
</div>
Joan Tomàs-Buliart<br>
+34 931 785 950<br>
<a href="http://www.marfeel.com">www.marfeel.com</a><br>
<a
href="http://blog.marfeel.com/earn-money-marfeel-referral-program/">Discover
our referral program!!</a><br>
</div>
</body>
</html>