Skip to content

Commit b853077

Browse files
authored
[docs] Update in-memory cache warm up (#7143)
2 parents a949a08 + dc1e301 commit b853077

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/source/routing/performance/caching/in-memory.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,19 @@ then look at `apollo.router.schema.loading.time` and `apollo.router.query_planni
8080

8181
If the router is using distributed caching for query plans, the warm-up phase will also store the new query plans in Redis. Since all Router instances might have the same distributions of queries in their in-memory cache, the list of queries is shuffled before warm-up, so each Router instance can plan queries in a different order and share their results through the cache.
8282

83+
<MinVersion version="1.61.0">
84+
85+
#### Cache warm-up with headers
86+
87+
</MinVersion>
88+
89+
With router v1.61.0+ and v2.x+, if you have enabled exposing query plans via `--dev` mode or `plugins.experimental.expose_query_plan: true`, you can pass the `Apollo-Expose-Query-Plan` header to return query plans in the GraphQL response extensions. You must set the header to one of the following values:
90+
91+
- `true`: Returns a human-readable string and JSON blob of the query plan while still executing the query to fetch data.
92+
- `dry-run`: Generates the query plan and aborts without executing the query.
93+
94+
After using `dry-run`, query plans are saved to your configured cache locations. Using real, mirrored, or similar to production operations is a great way to warmup the caches before transitioning traffic to new router instances.
95+
8396
## Caching automatic persisted queries (APQ)
8497

8598
[Automatic Persisted Queries (**APQ**)](/apollo-server/performance/apq/) enable GraphQL clients to send a server the _hash_ of their query string, _instead of_ sending the query string itself. When query strings are very large, this can significantly reduce network usage.

0 commit comments

Comments
 (0)