I dont think it is CAS. I have encapsulated my code in a try catch block and it did not throw any exception.
try
{
PartCacheWrite(Shared, "Key", "Value", NoAbsoluteExpiration, System.TimeSpan.FromMinutes(10));
if(PartCacheRead(Shared, "Key") != null)
{
var = (ValueType)PartCacheRead(Shared, "Key");
}
dataGrid.DataSource = var;
dataGrid.DataBind();
}
catch(Exception ex)
{
lblError.Text = ex.Message;
lblError.Visible = true;
}
The if statement always returns true. if it was CAS an SPException would have been thrown when i tried writing to the Cache.