What you are trying to do here is not really the job of your application.
Let’s assume your caching interface is something like this.
public class CacheManager
{
protected ICacheProvider _repository;
public CacheManager(ICacheProvider repository)
{
_repository = repository;
}
public void Store(string key, object data)
{
_repository.Store(key, data);
}
public void Destroy(string key)
{
_repository.Destroy(key);
}
public T Get<T>(string key)
{
return _repository.Get<T>(key);
}
}
If this is the case, what are your choices if all memcache servers are down? You can only continue to live normal by accessing your db/filessystem/etc. After all, cache by definition is not reliable.
Assuming that your memcached is running on *nix servers, you should be looking at ways to monitor it from the network or OS level. Memcached has a wiki page for this. Write rules/scripts to parse and inform your admin and bring it up. Your simplest option is to use munin IMHO