I add a value to couchbase cache with expiration 1 seconds, however it was expired in more than 20 seconds. What is cache expiration policy of membase?
Here is my code
public string TestCache()
{
String spoon = null;
using (var client = new CouchbaseClient())
{
spoon=client.Get<string>("Spoon");
if(string.IsNullOrEmpty(spoon))
{
client.Store(StoreMode.Set,
"Spoon",
"Hello, Couchbase! Cache data is" + DateTime.Now.ToString(),
TimeSpan.FromSeconds(1));
}
spoon = client.Get<string>("Spoon");
}
return string.IsNullOrEmpty(spoon)
? "Can not get data from cache"
: "Data from cache: " + spoon;
}