#26233 [Bug]: Redis env vars ignored when cache_params has any keys - breaks spend tracking with multiple pods
### Check for existing issues
- [x] I have searched the existing issues and checked that my issue is not a duplicate.
### What happened?
Found a bug that broke our spend tracking in production. When you set `cache: true` with `cache_params` that has literally any key in it (like `mode: default_off`), the proxy completely ignores Redis environment variables and falls back to in-memory cache instead.
This is a problem because spend tracking between pods relies on Redis to sync counters. Without it, each pod tracks usage independently and the whole thing falls apart.
Took me a while to debug but the issue is in `proxy_server.py` around line 3138:
```python if ( cache_type == "redis" or cache_type == "redis-semantic" ) and len(cache_params.keys()) == 0: cache_host = get_secret("REDIS_HOST", None) # ... ```
The `len(cache_params.keys()) == 0` check means it only loads Redis from env vars when cache_params is completely empty. If you add `mode` or any other key, this condition fails and Redis config from env never gets added.
Then later when the code checks `isinstance(litellm.cache.cache, RedisCache)` to set up spend_counter_cache, it returns False because we got InM…