option 2 has a draw back that the invalid contents stay in the cache until its time for ejection. And worst part is that<br>valid contents may keep getting ejected. For instance if the TTL values for these invalid content is very high then the cache
<br>does take a hit.<br><br><div><span class="gmail_quote">On 10/5/07, <b class="gmail_sendername">Dustin Sallings</b> <<a href="mailto:dustin@spy.net">dustin@spy.net</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;">
<div style=""><span class="q">
<br><div><div>On Oct 4, 2007, at 2:36 , Venkatesh KS wrote:</div><br><blockquote type="cite"><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
1. Tag each entry (as discussed in the other thread) with a gen count and once we want to invalidate<span> </span><br>incr the global gen count. While looking up, if the gen count of the entry is less than the global gen count
<br>for a given prefix (or tag) then return null.<br><br>2. Each key also has a gen count as a part of the key (for a given prefix or a tag). When we want to invalidate<span> </span><br>then bump up the gen count in the client. So all subsequent lookups will fail.
<br><br>3. Write a regex engine (or a tag feature) which will go an invalidate all the entries matching a prefix or a tag.<br></span></blockquote><br></div></span><div><span style="white-space: pre;">        </span>2 is common, but the tag invalidation is closer to #3 than #1 (as I'm inferring from your description of #1).
<br></div><br><div> <span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<div>-- </div><div>Dustin Sallings</div><br></span> </div><br></div></blockquote></div><br>