Is there a reason why you don&#39;t want to use a database?<br><br><div class="gmail_quote">On Tue, Mar 9, 2010 at 4:37 AM, Markus Jelsma <span dir="ltr">&lt;<a href="mailto:markus@buyways.nl">markus@buyways.nl</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Storing data in memcache can be done from almost any language available. You<br>
need to run a memcached server [1] somewhere and connect to it from some<br>
program. Then you can simply set key/value pairs.<br>
<br>
A PHP example:<br>
$m = new Memcache(&#39;host&#39;);<br>
$m-&gt;set(&#39;key&#39;, &#39;value&#39;);<br>
<br>
If you set all your user/IP pairs in the cache, you can then retrieve them in<br>
your Nginx config. Make sure you have the memc module compiled in. It would<br>
also be a good idea to compile the eval module; with it, you can store the<br>
value in a variable.<br>
<br>
Then, using that value (the IP address), you can select your backend.<br>
<br>
[1]: <a href="http://memcached.org/" target="_blank">http://memcached.org/</a><br>
<div><div></div><div class="h5"><br>
On Tuesday 09 March 2010 13:19:04 ramprasad_ap wrote:<br>
&gt; Can you give me an example how to store an array in memcache<br>
&gt;<br>
&gt; I am quiet new to ngnix , Do I require any extramodules or is memcache<br>
&gt;  always a part of nignx<br>
&gt;<br>
&gt; Posted at Nginx Forum:<br>
&gt;  <a href="http://forum.nginx.org/read.php?2,61798,61812#msg-61812" target="_blank">http://forum.nginx.org/read.php?2,61798,61812#msg-61812</a><br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; nginx mailing list<br>
&gt; <a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
&gt; <a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><br>
&gt;<br>
<br>
</div></div><div class="im">Markus Jelsma - Technisch Architect - Buyways BV<br>
<a href="http://www.linkedin.com/in/markus17
050-8536620" target="_blank">http://www.linkedin.com/in/markus17<br>
050-8536620</a> / 06-50258350<br>
<br>
<br>
_______________________________________________<br>
</div><div><div></div><div class="h5">nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><a href="http://www.miami-criminallaw.com">http://www.miami-criminallaw.com</a><br><br>--<br><br><br><br><br><br>