<br><br><div class="gmail_quote">On Thu, Mar 5, 2009 at 12:34 PM, Marcus Clyne <span dir="ltr">&lt;<a href="mailto:eugaia@gmail.com">eugaia@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



  

<div bgcolor="#ffffff" text="#000000">
<br>
For populating the cache, have you looked at the error_file directive. 
You can set the error file to script which could be passed to an FCGI
process, so that on a cache-miss the script is called to generate the
page, which could in the process put the file into the memcached
cache.  </div></blockquote><div><br>Marcus, <br><br>I believe Daniel  was talking about the opposite. He want to populate the cache if nginx hits the file instead of when it does not find it.<br><br>So something like this (this is how nginx would do it<br>
<br>request comes from /files/1.txt<br>1. Check if memcache exists and serve from there.<br>2. Check if file exist and serve from here.  &lt;---- This is where he wants to hook it :-)<br>3. If file does not exists, handle error.<br>
<br>What Daniel wants (if I understood correctly)<br>request comes from /files/1.txt<br>
1. Check if memcache exists and serve from there.<br>
2. if(-f file ) call the perl/fcgi process that populates the memcache cache and returns the file. (so this would be done only where there is no cache in memcache)<br>3. If file does not exists, handle error.<br>
<br><br>Still I dont see whats the point of this but yes it is doable.<br><br>best regards<br><br><br><br><br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000">This of course only really makes sense for dynamically-generate
content.<br><font color="#888888">
<br>
Marcus.</font><div><div></div><div class="h5"><br>
 <br>
<br>
Atif Ghaffar wrote:
<blockquote type="cite">Daniel, <br>
  <br>
I see now your other posts, <br>
  <br>
I do not think that you will get any benifit of using memcached with
static files.<br>
Nginx is already very optimized at serving static files.<br>
  <br>
  <br>
  <div class="gmail_quote">On Wed, Mar 4, 2009 at 11:17 PM, Daniel
Rhoden <span dir="ltr">&lt;<a href="mailto:drhoden@iiwinc.com" target="_blank">drhoden@iiwinc.com</a>&gt;</span>
wrote:<br>
  <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">This
is purely speculative, so please don&#39;t think I know how to do this.
 I&#39;m throwing this out so hopefully, if a good idea, the right people
can create the example.<br>
    <br>
Memcached has a good assortment of Perl clients.<br>
    <br>
Nginx has a means of embedding Perl into the configuration.<br>
    <br>
Couldn&#39;t there be a way of combining these to immediately populate the
cache when the cache returns missing?<br>
    <br>
By the way, I&#39;m looking at this as a means of improving I/O for static
pages (on SliceHost).  Ideally nginx&#39;s Memcached Module would have the
ability to do this when the requested filename exists on the hard drive:<br>
(-f $request_filename/index.html)<br>
    <font color="#888888"><br>
    <br>
Daniel Rhoden<br>
Director of Information Technology<br>
Interactive Internet Websites, Inc.<br>
3854 - 2 Killearn Court<br>
Tallahassee, Florida 32309<br>
Voice: (256) 878-5554<br>
E-Mail: <a href="mailto:drhoden@iiwinc.com" target="_blank">drhoden@iiwinc.com</a><br>
Website: <a href="http://iiwinc.com" target="_blank">iiwinc.com</a><br>
    <br>
    <br>
    </font></blockquote>
  </div>
  <br>
  <br clear="all">
  <br>
-- <br>
best regards<br>
Atif Ghaffar<br>
</blockquote>
<br>
</div></div></div>

</blockquote></div><br><br clear="all"><br>-- <br>best regards<br>Atif Ghaffar<br>