public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
{
var cacheControl = actionExecutedContext.Result.Headers.CacheControl;
if (cacheControl == null)
{
cacheControl = actionExecutedContext.Result.Headers.CacheControl = new CacheControlHeaderValue();
}
switch (Cacheability)
{
case CacheabilityValue.Public:
cacheControl.Public = true;
break;
case CacheabilityValue.Private:
cacheControl.Private = true;
break;
default:
cacheControl.NoCache = true;
break;
}
cacheControl.NoStore = NoStore;
cacheControl.SharedMaxAge = SharedMaxAge;
cacheControl.MaxAge = MaxAge;
cacheControl.MinFresh = MinFresh;
cacheControl.MaxStale = MaxStale;
cacheControl.OnlyIfCached = OnlyIfCached;
cacheControl.MustRevalidate = MustRevalidate;
cacheControl.ProxyRevalidate = ProxyRevalidate;
cacheControl.NoTransform = NoTransform;
base.OnActionExecuted(actionExecutedContext);
}