How To Distinguish Between a Crashed Server and Non-Existent Memcached Key Value?

Ask Bjørn Hansen ask at develooper.com
Sun Jun 4 10:39:36 UTC 2006


On Jun 4, 2006, at 2:35 AM, Andreas Vierengel wrote:

> that's right, but it could lead to a nice DoS-Attack especially if  
> (for example) a web-request leads to a specific key which cannot be  
> filled from the original source, because the original source  
> produces 'undef' as well.

Huh, that makes no sense.    If you don't fill anything in the cache,  
of course you will have to try calculating the response again.    How  
else could it possible work?  If you want to cache an explicit  
application specific "empty" result, you'll have to explicitly cache  
that.

> One solution could be that you never let this happen and always  
> generate a "reasonable" value for this key, or you could hack  
> Cache::Memcached to  add a undef-state using the flags-field.

If your responses are always say an HTML fragment you can just use  
"0" as the "no result".  Or depending on your language maybe an empty  
string.  Or if you cache more complex data structures there's no end  
to the possibilities...

  - ask

-- 
http://askask.com/  - http://develooper.com/




More information about the memcached mailing list