코드에서 출력 캐싱을 취소 할 수 있는지 알고있는 사람이 있습니까? 나가 말하고 싶은 것은 내가 자식 동작에 출력 캐싱을 배치하면 다음과 같이 자식 동작 내부에서 캐싱을 취소 할 수있는 조건을 기반으로 할 수 있는가? 난 당신이있을 거라 생각 :ChildAction에서 출력 캐싱을 취소하십시오.
// Only cache output if this wasn't an error
if (!wasException) {
ChildActionCacheInternal.Add(uniqueId, capturedText,
DateTimeOffset.UtcNow.AddSeconds(Duration));
}
나는이 문제를 해결하는 훌륭한 방법을 볼 수 없습니다 : 그것은 유일한 논리처럼 보이는
[ChildActionOnly]
[OutputCache(Duration = 36000, VaryByParam="tagslug")]
public virtual ActionResult MostViewed(string tagslug, int count)
{
// Make an API call here. If not data returned do not cache the ChildAction as specified above
}