Hi all,<br><br>&nbsp; I&#39;ve been working on implementing a ESI (Edge Side
Include) Proxy caching server.&nbsp;&nbsp; The idea is very similar to SSI
(Server Side Include), except the includes are remote instead of local.<br><br>There&#39;s a very nice write up of using SSI in this context with nginx and memcached here =&gt; 
<a href="http://blog.kovyrin.net/2007/08/05/using-nginx-ssi-and-memcache-to-make-your-web-applications-faster/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://blog.kovyrin.net/2007/08/05/using-nginx-ssi-and-memcache-to-make-your-web-applications-faster/
</a><br>
<br>My project is mongrel-esi (<a href="http://code.google.com/p/mongrel-esi" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://code.google.com/p/mongrel-esi</a>) and I&#39;d like to use it as an example of how one can use memcache and still invalidate URLs using regular expressions.&nbsp;&nbsp; 
<br><br>The basic idea is to store the regular expressions that have
been picked up by processing an invalidation rule in memcache.&nbsp;&nbsp; Before
retrieving a key from memcache checking if the key matches any of the
regular expressions in the invalidation-key and that the object being
cached is older then the invalidation rule that matched. &nbsp; We can
probably be clever about how we name the invalidation-key so that it
too can expire. &nbsp; So long as the invalidation-key doesn&#39;t expire before
a predetermined max-expiration time that all keys get.&nbsp; Then we can be
certain that either before we request a key, or the keys expiration
time the objects marked to expire by the regex will expire as requested
by surrogate.&nbsp;&nbsp; <br><br>For me this realization is great because it means I can
finish implementing the proxy server using memcached as the cache
storage.&nbsp;&nbsp; Hopefully, it also will be a helpful solution for others
looking to access all the keys.&nbsp;&nbsp; And&nbsp; of course, I may&nbsp; be&nbsp; missing
something important, so please correct me if I have.
<br><br>With this solution I think it&#39;s important to get the clever
part about making sure the expire rules have an expire time on them
that is greater then or equal to the expire time of all keys.&nbsp; There
may also be some ways to name the keys based on the specific domain to
have more then one invalidation key to avoid letting it grow into a
large dataset that needs to be retrieved everytime. &nbsp; It also means you
have two hits on memcache per key lookup instead of the one before...&nbsp;&nbsp;
There are probably other techniques for solving this problem...&nbsp; Just
hoping it makes sense and is useful to others... <br><span class="sg"><br>-Todd</span>