Almost everyone who uses memcache for the first time, asks that question, me included. However after using memcache for some time now I have the opinion that NOT having access to the list of key names is probably one of the better features of memcached.
<br><br>By saying this, I mean that the reason people WANT the list of keys is because they are wanting to use memcached in a way that its not really optimal for. It is not a system for storage. It is not an SQL query cache. It is an object cache. And should be used as an object cache.
<br><br>Normally people ask this question because they want to be able to retrieve a list of keys so that they can determine which ones need to be removed. If you need to do this with your system design, then you have designed it wrong.
<br><br>Now, admittedly, there are always fringe cases where a careful and meticulous system design could benefit from being able to retrieve the list of keys. But I would be surprised if anyone can come up with more than a couple of specific instances.
<br><br>If you want the list of keys for debugging purposes, you can always start up the memcached server in verbose mode and that way you will know what is happening in far more detail.<br><br>In conclusion, I'm firmly against adding that feature, because it will encourage people to use memcached in ways that its really not designed for, and then complaining that it doesn't work as well as other solutions (which are designed for it). memcached is simple, and it should be kept that way. Thats what is so great about it.
<br><br>PS: I do like the idea of tags, but not as a work-around for the limitations of obtaining a list of keys.<br><br><div><span class="gmail_quote">On 9/7/07, <b class="gmail_sendername">Ajinkya Nahar</b> <<a href="mailto:email@example.com">
firstname.lastname@example.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br><br>According to me, I don't think we have such feature yet.
<br>However, this will be really helpful.<br><br>Regards,<br>Ajinkya<br><br><br>-----Original Message-----<br>From: <a href="mailto:email@example.com">firstname.lastname@example.org</a><br>[mailto:<a href="mailto:email@example.com">
firstname.lastname@example.org</a>] On Behalf Of Fil Matthews<br>Sent: Friday, September 07, 2007 12:11 PM<br>To: <a href="mailto:email@example.com">firstname.lastname@example.org</a><br>Subject: Listing Keys in Cache ??
<br><br>Gentleman<br><br>I have just subscribed to the official mailing list. But I thought I<br>would throw this question into the pool.<br><br>Forgive my ignorance as I am new to memcached but is there anyway to<br>simply ask the cache for a KEY listing of all keys cached???
<br><br>Values aren't necessary just the Keys???<br><br>Many thanks in advance<br><br><br>Fil<br><br><br></blockquote></div><br><br clear="all"><br>-- <br>"Be excellent to each other"