<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=GB2312" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
You have a couple options. If flushing all person data is a very
infrequent operation, you can do a "flush_all" command, which will
flush the entire cache, including all your product data. That's by far
the most efficient (on the memcached side, anyway) but obviously it
means your application will have to repopulate the whole cache, not
just the person data.<br>
<br>
Alternately, if you need to flush all your person data often, you can
add another prefix or suffix to your keys: a version number. When you
want to flush the person data, just increase the version number you
append to all your person keys. The old values will still be in the
cache, but you will never look them up and they will eventually fall
out of the cache because of the LRU algorithm.<br>
<br>
There is no way to perform bulk operations on a subset of the values in
the cache.<br>
<br>
If you tell us a little more about why you want to flush your person
data, one of us can probably offer some alternate approaches. Assuming,
that is, that one of the two suggestions above isn't suitable for you.<br>
<br>
-Steve<br>
<br>
<br>
Mingqi Shao wrote:
<blockquote
 cite="mid8e500b580609262048i5c42f895j7992734a306aa6a8@mail.gmail.com"
 type="cite">In pre-example, if I want to remove all persion data&nbsp; from
memcached, what shoule I to?<br>
I don't will run a separate memcached process for each object type.<br>
thanks.<br>
  <br>
  <div><span class="gmail_quote">2006/9/27, Steven Grimm &lt;
  <a href="mailto:sgrimm@facebook.com">sgrimm@facebook.com</a>&gt;:</span>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">¿É
ÒÔ¡£You can get the same effect by just putting a prefix in front of
    <br>
the IDs. So instead of a key of "foo" for a product, you'd use<br>
"product:foo". We do this very successfully with a large number of<br>
different object types.<br>
    <br>
If you can't do that, then you can also run multiple memcached
instances
    <br>
and fetch different object types from each instance. We actually do a<br>
bit of that as well; we modified our client code to look at the key and<br>
choose from separate lists of servers for certain object types.<br>
(Unfortunately due to some licensing ambiguities in the code we
    <br>
modified, we can't release those changes.)<br>
    <br>
-Steve<br>
    <br>
    <br>
ÉÛÃ÷᪠wrote:<br>
&gt; For example, I want to cache person and product information in<br>
&gt; memcached. Their key both are a identify of string type. Can I
create
    <br>
&gt; separate hash table for they in order to avoid a identify of a
person<br>
&gt; and a product are equivalent? thanks.<br>
    <br>
  </blockquote>
  </div>
  <br>
</blockquote>
<br>
</body>
</html>