How big are your swfs?  I believe that memcached by default can only store a value up to 1MB.  Also, I&#39;m not positive what benefit you would receive by caching the file in memcached because I believe the file would already be cached by the filesystem.<div>
<br></div><div>Davy<br><br><div class="gmail_quote">On Mon, Aug 31, 2009 at 3:07 PM, InterNetX - Jürgen Gotteswinter <span dir="ltr">&lt;<a href="mailto:juergen.gotteswinter@internetx.de">juergen.gotteswinter@internetx.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hallo folks again,<br>
<br>
i try to configure nginx to deliver swf files etc, and wanted to cache them within memcached. but until now i didnt have much success with that.<br>
what i already did:<br>
<br>
include/excluded parts of the config (flv part, swf part &amp; php part) and tested them one by one. no change... but if i try to open a sfv file via browser i see that nginx communicates with memcached and this error messages appears in the nginx error log (without the memcached part in the config i get the file as download, like expected)<br>

<br>
2009/08/31 18:34:40 [info] 23808#0: *1 key: &quot;/files/_somewhere/xxx/xxxx.flv&quot; was not found by memcached while reading response header from upstream, client: 62.<br>
116.129.3, server: media, request: &quot;GET /files/_somewhere/xxx/xxxx.flv HTTP/1.1&quot;, upstream: &quot;memcached://<a href="http://127.0.0.1:11211" target="_blank">127.0.0.1:11211</a>&quot;, host: &quot;<a href="http://ftp.xxx.org:8" target="_blank">ftp.xxx.org:8</a><br>

1&quot;<br>
<br>
it seems that nginx looks in memcached for the file, but it has not yet read from the disk so nginx cant find it inside memcached and throws me a 404<br>
<br>
<br>
heres my nginx.conf<br>
<br>
<br>
<br>
http {<br>
    include       /etc/nginx/mime.types;<br>
    default_type  application/octet-stream;<br>
<br>
<br>
    log_format  main  &#39;$http_host $remote_addr - $remote_user [$time_local] $request &#39;<br>
                      &#39;&quot;$status&quot; $body_bytes_sent &quot;$http_referer&quot; &#39;<br>
                      &#39;&quot;$http_user_agent&quot; &quot;$http_x_forwarded_for&quot;&#39;;<br>
<br>
    access_log  /var/log/nginx/access.log  main;<br>
<br>
    sendfile        on;<br>
    tcp_nopush     on;<br>
<br>
    #keepalive_timeout  0;<br>
    keepalive_timeout  65;<br>
<br>
    #gzip  on;<br>
    server {<br>
        listen       81;<br>
        server_name  media;<br>
<br>
        #charset koi8-r;<br>
<br>
        #access_log  logs/host.access.log  main;<br>
<br>
<br>
        location / {<br>
            root   /home/www/htdocs;<br>
            index  index.html index.htm;<br>
<br>
<br>
        error_page  404     <a href="http://failover.somewhere.de/404.html" target="_blank">http://failover.somewhere.de/404.html</a>;<br>
<br>
        location ~ \.flv$ {<br>
            memcached_pass <a href="http://127.0.0.1:11211" target="_blank">127.0.0.1:11211</a>;<br>
            set $memcached_key $uri;<br>
            root           /home/www/htdocs;<br>
        }<br>
<br>
        location ~ \.swf$ {<br>
            set $memcached_key $uri;<br>
            memcached_pass     <a href="http://127.0.0.1:11211" target="_blank">127.0.0.1:11211</a>;<br>
            root           /home/www/htdocs;<br>
        }<br>
<br>
     location ~ /\.ht* {<br>
            deny  all;<br>
        }<br>
     }<br>
}<br>
<br>
<br>
</blockquote></div><br></div>