Reputation: 95
We have two controllers with OutputCaching, one work fine, second one doesn't cache...
Example of working controller:
[OutputCache(Duration = 1, VaryByParam = "idc,key")]
public dynamic Get(string idc, string key)
{
string coins = idc;
string size = key;
try
{
Models.api.dicebets bets = new Models.api.dicebets();
return bets.LastBets(coins, size);
}
catch
{
return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Invalid request");
}
}
And example of similar controller with non-working OutpuCache:
[OutputCache(Duration = 3)]
public dynamic Get()
{
try
{
Models.api.dicebets bets = new Models.api.dicebets();
return bets.HighRolls();
}
catch
{
return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Invalid request");
}
}
I have already tried all combinations of OutputCache settings like:
[OutputCache(Duration = 3, VaryByParam = "None")]
[OutputCache(Duration = 3, VaryByParam = "*")]
[OutputCache(Duration = 3, VaryByParam = "")]
None seems to work....
Upvotes: 1
Views: 1483
Reputation: 95
We solved it by using third party caching solution: Strathweb.CacheOutput
Upvotes: 1