Hi,
I have a ASP.Net MVC appication, from one controller action I am calling another method, which is in another class, From that method I am calling another WebAPI action.
I have applied caching in the controller action using
OutputCache attribute.
But the caching is not working when the action in the controller called for the second time it again calls the method, which is in another class and the WebAPI action is also being called from that method.
The following is the controller action.
[OutputCache(CacheProfile = "MyCacheProfile")]
public List<Students> GetStudents()
{
List<Students> studentsList = _studentServiceClient.GetStudentsBasedOnDept(DeptName);
return studentsList;
}
<caching>
<outputCacheSettings>
<outputCacheProfiles>
<add name="MyCacheProfile" duration = "3600" varyByParam = "none" location = "Server" noStore = "false" />
</outputCacheProfiles>
</outputCacheSettings>
</caching>
I have tried all locations
Client, Server,ServerAndClient also tried nostore as true and false