# ApolloServer 3 caching - Diminished performance when Redis is down

**URL:** <https://community.apollographql.com/t/apolloserver-3-caching-diminished-performance-when-redis-is-down/7040>\
**Category:** Server\
**Tags:** server\
**Created:** [December 7, 2023, 8:13pm UTC](https://community.apollographql.com/t/apolloserver-3-caching-diminished-performance-when-redis-is-down/7040 "2023-12-07T20:13:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vince\_Tamosaitis](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/vince_tamosaitis/32/4797_2.png) [@Vince\_Tamosaitis](https://community.apollographql.com/u/Vince_Tamosaitis)\
**Post date:** [December 7, 2023, 8:13pm UTC](https://community.apollographql.com/t/apolloserver-3-caching-diminished-performance-when-redis-is-down/7040/1 "2023-12-07T20:13:55Z")

</div>

I have Apollo Server set up with a Keyv Redis cache and I’d like to fallback on the default, non-caching behavior when Redis is down. Functionally, I am achieving this, but I am seeing significantly diminished performance. I am able to improve the performance by providing the Keyv constructor with ioredis optionals:

```auto
{
    maxLoadingRetryTime: 100,
    maxRetriesPerRequest: 0
};

```

However, even with these provided, I observe that requests take seconds (~10x) longer. This is true even for operations with maxAge set to 0. The documentation states these should not be cached, so I’d assume these should not be affected by the state of the Redis connection at all.

Is there some optional or cache configuration that I am missing? Keep in mind that this is using version 3 and I am not currently in a position to upgrade.

---

<div class="post-metadata">

**Author:** ![Vince\_Tamosaitis](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/vince_tamosaitis/32/4797_2.png) [@Vince\_Tamosaitis](https://community.apollographql.com/u/Vince_Tamosaitis)\
**Post date:** [December 7, 2023, 8:35pm UTC](https://community.apollographql.com/t/apolloserver-3-caching-diminished-performance-when-redis-is-down/7040/2 "2023-12-07T20:35:37Z")

</div>

I have found that these settings force all requests to wait for the application to attempt reconnection to the Redis server maxRetriesPerRequest times. This is unavoidable for the requests that are cached, but **I would like to skip this process for requests with responses that have maxAge set to 0, as these should never be dependent on the cache anyway.**

---

<div class="post-metadata">

**Author:** ![Justin\_Gonzalez](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/justin_gonzalez/32/5359_2.png) [@Justin\_Gonzalez](https://community.apollographql.com/u/Justin_Gonzalez)\
**Post date:** [February 6, 2025, 8:47pm UTC](https://community.apollographql.com/t/apolloserver-3-caching-diminished-performance-when-redis-is-down/7040/3 "2025-02-06T20:47:53Z")

</div>


