Apollo.Common.Cache is meant to be a consistent memcached interface for application use. It is currently based on the BeIT memcached client library, with additional extensions.

Apollo.Common.Cache

There are currently two versions of the Apollo.Common.Cache:
Versions > 0.7 require the .Net 3.5 runtime.
Versions < 0.7 may be used with the .Net 2.0 runtime.

See here for stand-alone client

Using Apollo.Common.Cache client.

You should use the Get(string, Func<T>) overload for most situations, this will retrieve based on the string, or use the Func<T> callback if it doesn't exist, and will set that into the memcached.

using Apollo.Common.Cache;
...

private SomeObject GetValueFromDatabase(...)
{
    //logic to retreive values from database
}

public SomeObject GetValue(...)
{
   return MC.Client.Get("somekey", () => GetValuesFromDatabase(...));
} 

Last edited Dec 18, 2008 at 1:48 AM by tracker1, version 2

Comments

No comments yet.