/// <summary> /// Action to occur after the action method is invoked /// </summary> /// <param name="actionExecutedContext">The action executed context</param> public override void OnActionExecuted( HttpActionExecutedContext actionExecutedContext) { if (!actionExecutedContext.IsASuccessfulResponse()) return; InvalidateOutputCache(actionExecutedContext); }
/// <summary> /// Action to occur after the action method is invoked /// </summary> /// <param name="actionExecutedContext">The action executed context</param> public override void OnActionExecuted( HttpActionExecutedContext actionExecutedContext) { if (!actionExecutedContext.IsASuccessfulResponse()) return; RemoveIfExists(actionExecutedContext); }
/// <summary> /// Action to occur after the action method is invoked /// </summary> /// <param name="actionExecutedContext">The action executed context</param> public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext) { actionExecutedContext.NotNull(nameof(actionExecutedContext)); if (!actionExecutedContext.IsASuccessfulResponse()) return; if (!IsCachingAllowed(actionExecutedContext.ActionContext)) return; if (actionExecutedContext.Response.Content.IsNull()) return; ApplyCacheHeaders(actionExecutedContext.Response); }
/// <summary> /// Action to occur after the action method is invoked /// </summary> /// <param name="actionExecutedContext">The action executed context</param> public override void OnActionExecuted( HttpActionExecutedContext actionExecutedContext) { actionExecutedContext.NotNull(nameof(actionExecutedContext)); if (!actionExecutedContext.IsASuccessfulResponse()) return; if (!IsCachingAllowed(actionExecutedContext.ActionContext)) return; if (CacheTime.AbsoluteExpirationTime <= _nowFactory()) return; var cacheKey = GetCacheKey(actionExecutedContext.ActionContext); if (cacheKey.IsNullOrEmpty() || ExistsItemInCache(actionExecutedContext, cacheKey) || actionExecutedContext.Response.Content.IsNull()) return; StoreContent(actionExecutedContext, cacheKey); ApplyCacheHeaders(actionExecutedContext.Response); }