From 63fbd57f619f5e3c5bf6ea4eb5e098cbcde3f8ec Mon Sep 17 00:00:00 2001 From: Yusuf Efe <120668197+yuefdev@users.noreply.github.com> Date: Mon, 14 Sep 2026 16:27:34 +0300 Subject: [PATCH] fix(caching): retain explicit cache guard for async reads --- litellm/caching/caching_handler.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/litellm/caching/caching_handler.py b/litellm/caching/caching_handler.py index a4e414274bd..0e7a1d58f0f 100644 --- a/litellm/caching/caching_handler.py +++ b/litellm/caching/caching_handler.py @@ -208,10 +208,8 @@ class LLMCachingHandler: """ # Check if caching should be performed BEFORE doing expensive operations if ( - ( - (kwargs.get("caching", None) is None and litellm.cache is not None) - or kwargs.get("caching", False) is True - ) + litellm.cache is not None + and (kwargs.get("caching", None) is None or kwargs.get("caching", False) is True) and (kwargs.get("cache", {}).get("no-cache", False) is not True) and self._is_call_type_supported_by_cache( original_function=original_function, call_type=call_type, kwargs=kwargs