Skip to content

Response caching not working with Connectors #9922

Description

@vjvista

Note: I'm not 100% sure whether this qualifies as a bug or an unsupported
feature — the documentation isn't clear on whether Response Caching is
intended to work with Apollo Connectors. The Connectors limitations page
lists "Entity caching" as unsupported, but that refers to the deprecated
entity-cache feature, not the current Response Caching feature. Filing as a
bug since it's the closest category; happy to have it reclassified.

Describe the bug

Apollo Router v2.17.0 Response Caching does not populate the cache for
Connector-sourced (@connect) responses, while it does cache responses
from a classic Apollo Server subgraph under an otherwise identical setup.

Minimal, self-contained reproduction repo: https://github.com/vjvista/graphql-connector-caching

To Reproduce

Full, runnable steps are in the reproduction repo's README:
👉 https://github.com/vjvista/graphql-connector-caching

In short:

  1. Clone the repo, npm install, and add GraphOS credentials to .env
    (Response Caching requires a GraphOS connection; free plan is fine).
  2. Start the mock REST origin (npm run rest), then run the connector case:
    npm run compose:connector && npm run up && bash scripts/check-cache.sh
  3. See the result: 0 keys written to Redis — RESULT: NOT CACHED.

For the control case, repeat with only the subgraph type swapped
(npm run classic, npm run compose:classic) — that run writes keys to Redis
(RESULT: CACHED). Only the subgraph type differs between the two runs; the
router config, Redis, origin data, and Cache-Control header are identical.

Desktop (please complete the following information):

• OS: macOS (Darwin) — router runs in Docker ( redis:7-alpine ,
 ghcr.io/apollographql/router:v2.17.0 )
• Version:
• Apollo Router  v2.17.0 
• Federation  v2.12 , Connectors  connect/v0.3 
• Redis 7
• Node 24,  @apollo/server  5.x,  @apollo/subgraph  2.14.x
•  rover  0.41.x

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions